![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
remove-bom-stream
Advanced tools
The remove-bom-stream npm package is designed to remove Byte Order Marks (BOM) from streams. BOMs are special markers at the start of a text stream that indicate the encoding used. This package is particularly useful when dealing with text files that may have BOMs, which can cause issues in processing or parsing the text.
Remove BOM from a stream
This feature allows you to remove the BOM from a readable stream and pipe the cleaned data into a writable stream. In this example, the BOM is removed from 'input.txt' and the result is written to 'output.txt'.
const fs = require('fs');
const removeBomStream = require('remove-bom-stream');
fs.createReadStream('input.txt')
.pipe(removeBomStream())
.pipe(fs.createWriteStream('output.txt'));
The strip-bom-stream package also removes BOM from streams. It is similar to remove-bom-stream in functionality but may have different performance characteristics or additional features. Both packages are used to clean BOMs from text streams, making them suitable for similar use cases.
The strip-bom package is used to remove BOM from strings and buffers rather than streams. While it serves a similar purpose, it is more suitable for scenarios where you are dealing with text data in memory rather than streaming data.
Remove a UTF8 BOM at the start of the stream.
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
})
);
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.
MIT
2.0.0 (2022-04-19)
remove-bom-buffer
(2107f34)TextDecoder
to process beginning of stream (2107f34)FAQs
Remove a UTF8 BOM at the start of the stream.
The npm package remove-bom-stream receives a total of 0 weekly downloads. As such, remove-bom-stream popularity was classified as not popular.
We found that remove-bom-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.