Socket
Socket
Sign inDemoInstall

file-fetch

Package Overview
Dependencies
19
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    file-fetch

fetch for read and write access to the local file system


Version published
Weekly downloads
7.6K
decreased by-9.15%
Maintainers
1
Install size
705 kB
Created
Weekly downloads
 

Readme

Source

file-fetch

file-fetch is a nodeify-fetch compatible fetch for read and write access to the local file system using file:// URLs (including implicit ones using relative paths).

Usage

Only the URL is required to read a file:

const fileFetch = require('file-fetch')

fileFetch('file://etc/hosts').then((res) => {
  res.body.pipe(stdout)
})

To write files the method PUT must be used and readable stream must be given as body:

fileFetch('file://tmp/example.log', {
  method: 'PUT',
  body: stream
})

Keywords

FAQs

Last updated on 09 Jun 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc