ShenNong_Simple/packages/字体精简工具/node_modules/remove-bom-stream
2024-10-30 15:28:42 +08:00
..
node_modules/through2 神农简化版 2024-10-30 15:28:42 +08:00
index.js 神农简化版 2024-10-30 15:28:42 +08:00
LICENSE 神农简化版 2024-10-30 15:28:42 +08:00
package.json 神农简化版 2024-10-30 15:28:42 +08:00
README.md 神农简化版 2024-10-30 15:28:42 +08:00

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