stripbom

Strip UTF-8 byte order mark (BOM) from a string. Works in all node versions.

Usage no npm install needed!

<script type="module">
  import stripbom from 'https://cdn.skypack.dev/stripbom';
</script>

README

stripbom NPM Module

Strip UTF-8 byte order mark (BOM) from a string. Works in all node versions.

Linux Build Windows Build

Coverage Status Dependency Status

bitHound Overall Score

Strip UTF-8 byte order mark (BOM) from a string

From Wikipedia:

The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8.

Why

Starting version 3.x of npmjs.com/strip-bom doesn't support node below v4, and previous versions have security issues, so this brings all the happiness to those who are still in supporting older versions of node business

Install

$ npm install --save stripbom

Usage

const stripBom = require('stripbom');

stripBom('\uFEFFunicorn');
//=> 'unicorn'

License

StripBOM is licensed under the MIT license.