cache-file
Store and get files from cache
Last updated 6 years ago by wblanchette .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cache-file 
SYNC missed versions from official npm registry.

Store and get files from cache with Node.js.

Getting started

Install with npm: npm install cache-file

Examples

var cache = require('cache-file');

// store test.jpg inside a test folder in cache
cache.store('test.jpg');

// get test.jpg from cache and save it as test-restored.jpg
cache.get('test.jpg', 'test-restored.jpg');

// check if test.jpg exists in cache
cache.check('test.jpg');

// get the path to test.jpg in cache
cache.path('test.jpg');

// remove test.jpg from cache
cache.clean('test.jpg');

API

.store(src, dest)

Store a file inside cache. Use dest to specify a custom name.

.get(src, dest)

Get a cached file and save it to a desired location.

.check(src)

Check if a cached file exists.

.path(src)

Get the path to a cached file.

.clean(src)

Remove a file from cache.

License

MIT License (c) Kevin Mårtensson

Current Tags

  • 0.1.7                                ...           latest (6 years ago)

2 Versions

  • 0.1.7                                ...           6 years ago
  • 0.1.6                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 10
Last Month 26
Dependencies (3)
Dev Dependencies (2)

Copyright 2014 - 2017 © taobao.org |