strip-bom-buf

4.0.0last stable release 1 year ago
Complexity Score
Low
Open Issues
0
Dependent Projects
25
Weekly Downloadsglobal
896,773

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

strip-bom-buf

Strip UTF-8 byte order mark (BOM) from a Uint8Array

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 strip-bom-buf

Usage

import fs from 'node:fs';
import stripBomBuffer from 'strip-bom-buf';

stripBomBuffer(fs.readFileSync('unicorn.txt'));
//=> 'unicorn'

Related

  • strip-bom - String version of this module
  • strip-bom-stream - Stream version of this module

Dependencies

Loading dependencies...

CVE IssuesActive
0
Scorecards Score
4.20
Test Coverage
No Data
Follows Semver
Yes
Github Stars
19
Dependenciestotal
6
DependenciesOutdated
1
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute strip-bom-buf in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install strip-bom-buf
Processing...
Done

5 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.