You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 902B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom)
  2. > Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string/buffer
  3. From Wikipedia:
  4. > 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.
  5. ## Install
  6. ```
  7. $ npm install --save strip-bom
  8. ```
  9. ## Usage
  10. ```js
  11. var fs = require('fs');
  12. var stripBom = require('strip-bom');
  13. stripBom('\uFEFFunicorn');
  14. //=> 'unicorn'
  15. stripBom(fs.readFileSync('unicorn.txt'));
  16. //=> 'unicorn'
  17. ```
  18. ## Related
  19. - [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module
  20. - [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module
  21. ## License
  22. MIT © [Sindre Sorhus](http://sindresorhus.com)