mirror of
https://github.com/Raghu-Ch/nodeRestAPI.git
synced 2026-02-11 05:03:02 -05:00
initial commit
This commit is contained in:
59
node_modules/strip-bom/readme.md
generated
vendored
Normal file
59
node_modules/strip-bom/readme.md
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# strip-bom [](https://travis-ci.org/sindresorhus/strip-bom)
|
||||
|
||||
> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string/buffer/stream
|
||||
|
||||
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.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
$ npm install --save strip-bom
|
||||
```
|
||||
|
||||
```js
|
||||
var fs = require('fs');
|
||||
var stripBom = require('strip-bom');
|
||||
|
||||
stripBom('\ufeffUnicorn');
|
||||
//=> Unicorn
|
||||
|
||||
stripBom(fs.readFileSync('unicorn.txt'));
|
||||
//=> Unicorn
|
||||
```
|
||||
|
||||
Or as a [Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform):
|
||||
|
||||
```js
|
||||
var fs = require('fs');
|
||||
var stripBom = require('strip-bom');
|
||||
|
||||
fs.createReadStream('unicorn.txt')
|
||||
.pipe(stripBom.stream())
|
||||
.pipe(fs.createWriteStream('unicorn.txt'));
|
||||
```
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```sh
|
||||
$ npm install --global strip-bom
|
||||
```
|
||||
|
||||
```
|
||||
$ 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](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user