Skip to content
Remove a UTF8 BOM at the start of the stream.
JavaScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.editorconfig Build: Enforce consistent line endings Aug 19, 2017
.eslintrc
.gitattributes
.gitignore Scaffold: Repository creation Jun 16, 2017
.jscsrc
.travis.yml
LICENSE
README.md Docs: Complete the README Jun 16, 2017
appveyor.yml Build: CI on only even node versions & add 8 Jul 5, 2017
index.js Update: Replace strip-bom-buffer dependency with remove-bom-buffer Jun 17, 2017
package.json

README.md

remove-bom-stream

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Remove a UTF8 BOM at the start of the stream.

Usage

var fs = require('fs');
var concat = require('concat-stream');
var removeBOM = require('remove-bom-stream');

fs.createReadStream('utf8-file-with-bom.txt')
  .pipe(removeBOM())
  .pipe(concat(function(result) {
    // result won't have a BOM
  }));

API

removeBOM()

Returns a through2 stream that will remove a BOM, given the data is a UTF8 Buffer with a BOM at the beginning. If the data is not UTF8 or does not have a BOM, the data is not changed and this becomes a normal passthrough stream.

License

MIT

You can’t perform that action at this time.