restore-npm-cache
Restore contents from an npm cache
const restoreNpmCache = ; async { await ; ; //=> {name: 'lodash', version: '4.17.10', description: 'Lodash modular utilities.', ...}};
Installation
npm install restore-npm-cache
API
const restoreNpmCache = ;
restoreNpmCache(key [, options])
key: string
options: Object
(node-tar's Unpack
constructor options with strict
defaulting to true
)
Return: Promise<Object>
It finds an npm cache entry identified by the given key, extract its contents from the gzipped tarball to a directory where cwd
option points (or process.cwd()
if cwd
is not provided), and returns a Promise
for information of the entry.
It automatically creates directories when the directory specified by cwd
option doesn't exist.
const readdir = promises;const restoreNpmCache = ; async { const info = await ; infointegrity; //=> 'sha512-hgrDtGWz368b7Wqf+ ... 5WRN1TAS6eo7AYA==' infosize; //=> 514066 infotime; //=> 538368647819 await ; /*=> [ 'CHANGELOG.md', 'LICENSE', 'README.md', 'bin', 'conf', 'lib', 'messages', 'package.json' ] */};
License
ISC License © 2018 Shinnosuke Watanabe