Initial commit
[yaffs-website] / node_modules / load-json-file / node_modules / strip-bom / readme.md
1 # strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom)
2
3 > Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string/buffer
4
5 From Wikipedia:
6
7 > 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.
8
9
10 ## Install
11
12 ```
13 $ npm install --save strip-bom
14 ```
15
16
17 ## Usage
18
19 ```js
20 var fs = require('fs');
21 var stripBom = require('strip-bom');
22
23 stripBom('\uFEFFunicorn');
24 //=> 'unicorn'
25
26 stripBom(fs.readFileSync('unicorn.txt'));
27 //=> 'unicorn'
28 ```
29
30
31 ## Related
32
33 - [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module
34 - [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module
35
36
37 ## License
38
39 MIT © [Sindre Sorhus](http://sindresorhus.com)