JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 84916532
  • Score
    100M100P100Q257872F
  • License MIT

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

Package Exports

  • strip-bom

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (strip-bom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

strip-bom Build Status

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

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.

Install

$ npm install --save strip-bom

Usage

var fs = require('fs');
var stripBom = require('strip-bom');

stripBom('\ufeffUnicorn');
//=> Unicorn

stripBom(fs.readFileSync('unicorn.txt'));
//=> Unicorn

CLI

You can also use it as a CLI app by installing it globally:

$ npm install --global strip-bom

Usage

$ strip-bom --help

Usage
  $ strip-bom <file> > <new-file>
  $ cat <file> | strip-bom > <new-file>

Example
  $ strip-bom unicorn.txt > unicorn-without-bom.txt

License

MIT © Sindre Sorhus