strip-bom-stream
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -1,6 +0,4 @@ | ||
import FirstChunkStream = require('first-chunk-stream'); | ||
import FirstChunkStream from 'first-chunk-stream'; | ||
declare namespace stripBomStream { | ||
type StripBomStream = FirstChunkStream; | ||
} | ||
export type StripBomStream = FirstChunkStream; | ||
@@ -12,4 +10,4 @@ /** | ||
``` | ||
import * as fs from 'fs'; | ||
import stripBomStream = require('strip-bom-stream'); | ||
import fs from 'node:fs'; | ||
import stripBomStream from 'strip-bom-stream'; | ||
@@ -21,4 +19,2 @@ fs.createReadStream('unicorn.txt') | ||
*/ | ||
declare function stripBomStream(): stripBomStream.StripBomStream; | ||
export = stripBomStream; | ||
export default function stripBomStream(): StripBomStream; |
17
index.js
@@ -1,13 +0,6 @@ | ||
'use strict'; | ||
const FirstChunkStream = require('first-chunk-stream'); | ||
const stripBomBuffer = require('strip-bom-buf'); | ||
import FirstChunkStream from 'first-chunk-stream'; | ||
import stripBomBuffer from 'strip-bom-buf'; | ||
module.exports = () => | ||
new FirstChunkStream({chunkLength: 3}, (error, chunk, encoding, callback) => { | ||
if (error) { | ||
callback(error); | ||
return; | ||
} | ||
callback(null, stripBomBuffer(chunk)); | ||
}); | ||
export default function stripBomStream() { | ||
return new FirstChunkStream({chunkSize: 3}, (chunk, _encoding) => stripBomBuffer(chunk)); | ||
} |
{ | ||
"name": "strip-bom-stream", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Strip UTF-8 byte order mark (BOM) from a stream", | ||
"license": "MIT", | ||
"repository": "sindresorhus/strip-bom-stream", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=8" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -38,12 +41,12 @@ "scripts": { | ||
"dependencies": { | ||
"first-chunk-stream": "^3.0.0", | ||
"strip-bom-buf": "^2.0.0" | ||
"first-chunk-stream": "^5.0.0", | ||
"strip-bom-buf": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^12.0.0", | ||
"ava": "^1.4.1", | ||
"get-stream": "^5.1.0", | ||
"tsd": "^0.7.3", | ||
"xo": "^0.24.0" | ||
"@types/node": "^16.6.1", | ||
"ava": "^3.15.0", | ||
"get-stream": "^6.0.1", | ||
"tsd": "^0.17.0", | ||
"xo": "^0.44.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# strip-bom-stream [![Build Status](https://travis-ci.org/sindresorhus/strip-bom-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom-stream) | ||
# strip-bom-stream | ||
@@ -9,3 +9,2 @@ > Strip UTF-8 [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a stream | ||
## Install | ||
@@ -17,8 +16,7 @@ | ||
## Usage | ||
```js | ||
const fs = require('fs'); | ||
const stripBomStream = require('strip-bom-stream'); | ||
import fs from 'node:fs'; | ||
import stripBomStream from 'strip-bom-stream'; | ||
@@ -32,3 +30,2 @@ fs.createReadStream('unicorn.txt') | ||
## Related | ||
@@ -38,6 +35,1 @@ | ||
- [strip-bom-buf](https://github.com/sindresorhus/strip-bom-buf) - Buffer version of this module | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
3578
19
32
+ Addedfirst-chunk-stream@5.0.0(transitive)
+ Addedstrip-bom-buf@3.0.1(transitive)
- Removedfirst-chunk-stream@3.0.0(transitive)
- Removedstrip-bom-buf@2.0.0(transitive)
Updatedfirst-chunk-stream@^5.0.0
Updatedstrip-bom-buf@^3.0.0