|
|
%!s(int64=2) %!d(string=hai) anos | |
|---|---|---|
| .. | ||
| node_modules | %!s(int64=2) %!d(string=hai) anos | |
| LICENSE | %!s(int64=2) %!d(string=hai) anos | |
| README.md | %!s(int64=2) %!d(string=hai) anos | |
| index.js | %!s(int64=2) %!d(string=hai) anos | |
| package.json | %!s(int64=2) %!d(string=hai) anos | |
Remove a UTF8 BOM at the start of the stream.
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
}));
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.
MIT