![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Detect, enforce or strip BOM signatures.
$ npm install bombom
/// <reference path="node_modules/bombom/bombom.d.ts" />
import bombom = require('bombom');
var bombom = require('bombom');
utf8
) used to point to a particular BOM signature. See pre-registered BOM types below.NodeBuffer
with an array of hex codes in it. For your convenience, you can register a new BOM type and signature by providing a simple number[]
.utf8: new Buffer([0xEF, 0xBB, 0xBF])
utf16le: new Buffer([0xFF, 0xFE])
utf16be: new Buffer([0xFE, 0xFF])
utf32le: new Buffer([0xFF, 0xFE, 0x00, 0x00])
utf32be: new Buffer([0x00, 0x00, 0xFE, 0xFF])
Detects if the specified buffer has a BOM signature and returns the type if it does.
Enforces the specified BOM type on the buffer. This will either add the BOM signature to the buffer or, if there is an existing BOM signature that is not of the type specified, it will replace it with the type specified.
Emits "error" if type is not registered
Checks whether the specified BOM type is already registered.
Checks whether the specified buffer is signed or not. If the type is specified, it only checks for that type.
Emits "error" if type is not registered
Registers a BOM type with a BOM signature (an array of hex values).
Emits "warn" if type is already registered
Strips off the BOM signature from the specified buffer and returns the new, stripped-off buffer. If the type is specified, it only strips off that type of signature, if it exists.
Emits "error" if type is not registered
Unregisters the specified BOM type.
Emits "warn" if type hasn't been registered
Released under the MIT license.
FAQs
Detect, enforce or strip BOM signatures.
The npm package bombom receives a total of 2 weekly downloads. As such, bombom popularity was classified as not popular.
We found that bombom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.