Socket
Socket
Sign inDemoInstall

remove-bom-stream

Package Overview
Dependencies
13
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remove-bom-stream

Remove a UTF8 BOM at the start of the stream.


Version published
Maintainers
1
Install size
284 kB
Created

Changelog

Source

2.0.0 (2022-04-19)

⚠ BREAKING CHANGES

  • Switch to streamx for streams (#10)
  • Require encoding option to avoid inspecting chunks for UTF-8 encoding (#8)
  • Normalize repository, dropping node <10.13 support (#3)

Features

  • Remove the dependency on remove-bom-buffer (2107f34)
  • Require encoding option to avoid inspecting chunks for UTF-8 encoding (#8) (2107f34)
  • Switch to streamx for streams (#10) (9867811)
  • Use node core's TextDecoder to process beginning of stream (2107f34)

Bug Fixes

  • Handle first chunk shorter than 7 bytes correctly when next chunks are larger (#7) (564f87b)

Miscellaneous Chores

  • Normalize repository, dropping node <10.13 support (#3) (8fece9c)

Readme

Source

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

Keywords

FAQs

Last updated on 05 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc