better-strip-bom
v1.0.0
Published
<div align="center">
Downloads
1
Readme
Better Strip BOM
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.
Install
$ npm install better-strip-bom
Usage
For strings
import { stripBom } from 'better-strip-bom';
stripBom('\uFEFFMagic Man, Magic Hands');
//=> 'Magic Man, Magic Hands'
For Buffers
import { stripBom } from 'better-strip-bom';
import { readFileSync } from 'fs';
stripBom(readFileSync('magic.txt'));
//=> 'Magic Man, Magic Hands'