Socket
Socket
Sign inDemoInstall

remove-bom-stream

Package Overview
Dependencies
4
Maintainers
2
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
Weekly downloads
1.5M
decreased by-2.92%
Maintainers
2
Install size
85.3 kB
Created
Weekly downloads
 

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 Coveralls Status

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('utf-8'))
  .pipe(
    concat(function (result) {
      // result won't have a BOM
    })
  );

API

removeBOM(encoding)

Returns a Transform stream that will remove a BOM, if the argument encoding is 'utf-8' and the given data is a UTF8 Buffer with a BOM at the beginning. If the encoding is not 'utf-8' or does not have a BOM, the data is not changed and this becomes a no-op Transform stream.

License

MIT

Keywords

FAQs

Last updated on 19 Apr 2022

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