You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <p align="center">
  2. <a href="http://gulpjs.com">
  3. <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
  4. </a>
  5. </p>
  6. # remove-bom-stream
  7. [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
  8. Remove a UTF8 BOM at the start of the stream.
  9. ## Usage
  10. ```js
  11. var fs = require('fs');
  12. var concat = require('concat-stream');
  13. var removeBOM = require('remove-bom-stream');
  14. fs.createReadStream('utf8-file-with-bom.txt')
  15. .pipe(removeBOM())
  16. .pipe(concat(function(result) {
  17. // result won't have a BOM
  18. }));
  19. ```
  20. ## API
  21. ### `removeBOM()`
  22. 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.
  23. ## License
  24. MIT
  25. [downloads-image]: http://img.shields.io/npm/dm/remove-bom-stream.svg
  26. [npm-url]: https://npmjs.com/package/remove-bom-stream
  27. [npm-image]: http://img.shields.io/npm/v/remove-bom-stream.svg
  28. [travis-url]: https://travis-ci.org/gulpjs/remove-bom-stream
  29. [travis-image]: http://img.shields.io/travis/gulpjs/remove-bom-stream.svg?label=travis-ci
  30. [appveyor-url]: https://ci.appveyor.com/project/gulpjs/remove-bom-stream
  31. [appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/remove-bom-stream.svg?label=appveyor
  32. [coveralls-url]: https://coveralls.io/r/gulpjs/remove-bom-stream
  33. [coveralls-image]: http://img.shields.io/coveralls/gulpjs/remove-bom-stream/master.svg
  34. [gitter-url]: https://gitter.im/gulpjs/gulp
  35. [gitter-image]: https://badges.gitter.im/gulpjs/gulp.png