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

cacheable-fs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cacheable-fs

Cacheable file system

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

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

Cacheable FS

Cacheable file system methods for holding file reads in memory

Usage

var cfs = require('cacheable-fs');

// Promise style
cfs.cache.readFile('path/to/file.txt').then(function(content) {
    // ... do something with content 
});

// Stream style
cfs.cache.createReadStream('path/to/file.txt')
    .pipe( ... );

Methods

Promisified

All of the following methods will return a promise

  • cache.readFile(path) - Read a file
  • cache.concat(files) - Concatenates an array of files
  • cache.copy(path) - Copies a file from one location to another creating directories
  • readFile(path, [...]) - Promisified wrapper to fs.readFile
  • writeFile(path, [...]) - Promisified wrapper to fs.writeFile

Other

  • cache.createReadStream(path) - Read a file (returns a stream)
  • cache.expire(path) - Expire a given path from cache
  • cache.getCache() - Returns the raw cache object (debugging)
  • cache.watch(fn) - Watch the file system and trigger a callback on each change or deletion. Callback is fn(eventName, path).
  • cache.unwatch() - Stop watching the file system

Properties

  • fs - Exposing graceful-fs

FAQs

Package last updated on 08 May 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