pax_global_header00006660000000000000000000000064126245442210014514gustar00rootroot0000000000000052 comment=af3e3b7093d302a7955cb23167caa60ca817333a strip-bom-stream-2.0.0/000077500000000000000000000000001262454422100147205ustar00rootroot00000000000000strip-bom-stream-2.0.0/.editorconfig000066400000000000000000000003471262454422100174010ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false strip-bom-stream-2.0.0/.gitattributes000066400000000000000000000000141262454422100176060ustar00rootroot00000000000000* text=auto strip-bom-stream-2.0.0/.gitignore000066400000000000000000000000151262454422100167040ustar00rootroot00000000000000node_modules strip-bom-stream-2.0.0/.jshintrc000066400000000000000000000002521262454422100165440ustar00rootroot00000000000000{ "node": true, "esnext": true, "bitwise": true, "curly": true, "immed": true, "newcap": true, "noarg": true, "undef": true, "unused": "vars", "strict": true } strip-bom-stream-2.0.0/.travis.yml000066400000000000000000000001101262454422100170210ustar00rootroot00000000000000sudo: false language: node_js node_js: - 'iojs' - '0.12' - '0.10' strip-bom-stream-2.0.0/fixture000066400000000000000000000000131262454422100163230ustar00rootroot00000000000000Unicorn strip-bom-stream-2.0.0/index.js000066400000000000000000000004271262454422100163700ustar00rootroot00000000000000'use strict'; var firstChunk = require('first-chunk-stream'); var stripBom = require('strip-bom'); module.exports = function () { return firstChunk({chunkLength: 3}, function (err, chunk, enc, cb) { if (err) { cb(err); return; } cb(null, stripBom(chunk)); }); }; strip-bom-stream-2.0.0/license000066400000000000000000000021371262454422100162700ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. strip-bom-stream-2.0.0/package.json000066400000000000000000000014221262454422100172050ustar00rootroot00000000000000{ "name": "strip-bom-stream", "version": "2.0.0", "description": "Strip UTF-8 byte order mark (BOM) from a stream", "license": "MIT", "repository": "sindresorhus/strip-bom-stream", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "node test.js" }, "files": [ "index.js" ], "keywords": [ "bom", "strip", "byte", "mark", "unicode", "utf8", "utf-8", "remove", "delete", "trim", "text", "stream", "streams" ], "dependencies": { "first-chunk-stream": "^2.0.0", "strip-bom": "^2.0.0" }, "devDependencies": { "ava": "0.0.4", "concat-stream": "^1.4.5" } } strip-bom-stream-2.0.0/readme.md000066400000000000000000000020251262454422100164760ustar00rootroot00000000000000# strip-bom-stream [![Build Status](https://travis-ci.org/sindresorhus/strip-bom-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom-stream) > Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a stream 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 --save strip-bom-stream ``` ## Usage ```js var fs = require('fs'); var stripBomStream = require('strip-bom-stream'); fs.createReadStream('unicorn.txt') .pipe(stripBomStream()) .pipe(fs.createWriteStream('unicorn.txt')); ``` It's a [Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform). ## Related - [strip-bom](https://github.com/sindresorhus/strip-bom) - Strip UTF-8 byte order mark (BOM) from a string/buffer - [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module ## License MIT © [Sindre Sorhus](http://sindresorhus.com) strip-bom-stream-2.0.0/test.js000066400000000000000000000010071262454422100162330ustar00rootroot00000000000000'use strict'; var fs = require('fs'); var test = require('ava'); var concat = require('concat-stream'); var fn = require('./'); test('main', function (t) { t.plan(1); fs.createReadStream('fixture') .pipe(fn()) .pipe(concat(function (data) { t.assert(data.toString() === 'Unicorn\n'); })); }); test('low `highWaterMark`', function (t) { t.plan(1); fs.createReadStream('fixture', {highWaterMark: 1}) .pipe(fn()) .pipe(concat(function (data) { t.assert(data.toString() === 'Unicorn\n'); })); });