stripbom

Strip UTF-8 byte order mark (BOM) from a string. Works in all node versions


Keywords
strip, bom, byte, order, mark, unicode, utf8, utf-8, remove, delete, trim, text, string, node, 0.10, 0.12
License
MIT
Install
npm install stripbom@3.0.0

Documentation

stripbom NPM Module

Strip UTF-8 byte order mark (BOM) from a string. Works in all node versions.

Linux Build Windows Build

Coverage Status Dependency Status

bitHound Overall Score

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.

Why

Starting version 3.x of npmjs.com/strip-bom doesn't support node below v4, and previous versions have security issues, so this brings all the happiness to those who are still in supporting older versions of node business

Install

$ npm install --save stripbom

Usage

const stripBom = require('strip-bom');

stripBom('\uFEFFunicorn');
//=> 'unicorn'

License

StripBOM is licensed under the MIT license.