New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

file-access

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

file-access

Easily fetch local or remote file, and return buffer data.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

file-access

version Codecov release node.js languages

Easily fetch local or remote file, and return buffer data.

Not suitable for accessing large files

轻松获取本地或远程文件, 并返回buffer数据。(不适用于大文件)

Usage

const {
  accessFile,
  accessLocalFileSync
} = require('file-access');


accessFile('/path/to/local.txt', (err, data) => {
  // ...
})

accessFile('https://example.com/file.zip').then((data) => {
  // ...
  console.log('file size : ', data.byteLength)
  conosle.log('content-type :', data.contentType)
})

const buffer = accessLocalFileSync('/path/to/local.txt')

Keywords

FAQs

Package last updated on 26 Dec 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc