Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strip-bom-buffer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-bom-buffer - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

5

index.js

@@ -11,5 +11,8 @@ /*!

var isBuffer = require('is-buffer');
var isUtf8 = require('is-utf8');
module.exports = function (buffer) {
if (!isBuffer(buffer)) return buffer;
if (!isBuffer(buffer) || !isUtf8(buffer)) {
return buffer;
}
if (String(buffer.slice(0, 3)) === '\ufeff') {

@@ -16,0 +19,0 @@ return buffer.slice(3);

8

package.json
{
"name": "strip-bom-buffer",
"description": "Strip a byte order mark (BOM) from a buffer.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/strip-bom-buffer",

@@ -23,3 +23,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"is-buffer": "^1.1.0"
"is-buffer": "^1.1.0",
"is-utf8": "^0.2.0"
},

@@ -42,3 +43,4 @@ "devDependencies": {

"cr",
"copy",
"has-bom",
"read-file",
"strip-bom-string"

@@ -45,0 +47,0 @@ ]

@@ -1,2 +0,2 @@

# strip-bom-buffer [![NPM version](https://badge.fury.io/js/strip-bom-buffer.svg)](http://badge.fury.io/js/strip-bom-buffer)
# strip-bom-buffer [![NPM version](https://badge.fury.io/js/strip-bom-buffer.svg)](http://badge.fury.io/js/strip-bom-buffer) [![Build Status](https://travis-ci.org/jonschlinkert/strip-bom-buffer.svg)](https://travis-ci.org/jonschlinkert/strip-bom-buffer)

@@ -17,2 +17,3 @@ > Strip a byte order mark (BOM) from a buffer.

var strip = require('strip-bom-buffer');
strip(new Buffer('\ufefffoo'));
```

@@ -22,4 +23,5 @@

* [copy](https://www.npmjs.com/package/copy): Copy files or directories using globs. | [homepage](https://github.com/jonschlinkert/copy)
* [cr](https://www.npmjs.com/package/cr): Strip windows carriage returns, or convert carriage returns to newlines. | [homepage](https://github.com/jonschlinkert/cr)
* [has-bom](https://www.npmjs.com/package/has-bom): Returns true if a buffer or string has a byte order mark (BOM) | [homepage](https://github.com/jonschlinkert/has-bom)
* [read-file](https://www.npmjs.com/package/read-file): Thin wrapper around fs.readFile and fs.readFileSync that also strips byte order marks when `utf8` encoding… [more](https://www.npmjs.com/package/read-file) | [homepage](https://github.com/jonschlinkert/read-file)
* [strip-bom-string](https://www.npmjs.com/package/strip-bom-string): Strip a byte order mark (BOM) from a string. | [homepage](https://github.com/jonschlinkert/strip-bom-string)

@@ -26,0 +28,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc