🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

file-fetch

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-fetch - npm Package Compare versions

Comparing version

to
1.4.1

2

index.js

@@ -69,3 +69,3 @@ const fs = require('fs')

const stream = new Readable({ read () {} })
const stream = new Readable()
stream.push(null)

@@ -72,0 +72,0 @@

{
"name": "file-fetch",
"version": "1.4.0",
"version": "1.4.1",
"description": "fetch for read and write access to the local file system",
"main": "index.js",
"scripts": {
"test": "standard && mocha"
"test": "standard && nyc --reporter=lcov --reporter=text mocha"
},

@@ -37,4 +37,5 @@ "repository": {

"mocha": "^6.2.2",
"nyc": "^15.0.0",
"standard": "^14.3.1"
}
}

@@ -173,2 +173,22 @@ const fs = require('fs')

it('should throw an error if the method is PUT, but the "file" is a directory', async () => {
const body = new Readable({
read: () => {
body.push('test')
body.push(null)
}
})
const res = await fileFetch('file://' + path.join(__dirname, 'support'), {
method: 'PUT',
body: body
})
assert.strictEqual(res.status, 500)
return new Promise((resolve) => {
res.body.on('error', resolve)
res.body.resume()
})
})
it('should throw an error if the given method is unknown', async () => {

@@ -175,0 +195,0 @@ const res = await fileFetch('file://' + path.join(__dirname, 'support/file.txt'), {