Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thdk/n-cache-r
Cache folders such as node_modules in gcs and restore them on next builds to reduce build time.
https://github.com/thdk/n-cache-r
cache google-cloud-build google-cloud-storage node-modules npm performance
Last synced: about 18 hours ago
JSON representation
Cache folders such as node_modules in gcs and restore them on next builds to reduce build time.
- Host: GitHub
- URL: https://github.com/thdk/n-cache-r
- Owner: thdk
- Created: 2020-11-07T15:43:04.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-20T17:28:28.000Z (almost 4 years ago)
- Last Synced: 2024-05-10T04:41:04.576Z (6 months ago)
- Topics: cache, google-cloud-build, google-cloud-storage, node-modules, npm, performance
- Language: TypeScript
- Homepage:
- Size: 705 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# n-cache-r (Node Cache Restore)
Cache node_modules in Google Cloud Storage or on disk and restore them on next builds.
## Install
You can find this package on `npm`.
`npm install n-cache-r`
## Example usage
**Node**
```javascript
const {
installPackage,
} = require("n-cache-r");installPackage({
bucketName: 'my-project-build-cache',
storageOptions: {
keyFilename: path.resolve(__dirname, '../service-account.json'),
},
});
```**CLI**
```
Usage: n-cache-r [options] [command]Options:
-h, --help display help for commandCommands:
install [options] Fetch node_modules from cloud storage bucket before installing the package.
help [command] display help for commandUsage: n-cache-r install [options]
Fetch node_modules from cloud storage bucket before installing the package.
Options:
--bucket Name of google cloud storage bucket. Used as cache location.
--cwd [cwd] Current working directory.
--key Path to key file with service account for Google cloud storage.
--no-cache Do not use cache bucket.
--cmd [cmd] Command to create node_modules folder. (default: "npm ci")
-h, --help display help for command.
```