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

file-fetch

Package Overview
Dependencies
Maintainers
1
Versions
14
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 1.4.0 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'), {

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