# cloud-build-cache

> Cache folders such as node_modules in gcs and restore them on next builds to reduce build time.

Latest version **0.3.9** (published 2020-11-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install cloud-build-cache
pnpm add cloud-build-cache
yarn add cloud-build-cache
bun add cloud-build-cache
```

Provides the command `cloud-build-cache`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.9 |
| Published | 2020-11-09 |
| First published | 2020-11-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 284.8 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Thomas Dekiere |
| Maintainers | thdk |
| Keywords | cloud build, cache, node_modules, artifacts, restore, cloud storage |

## Links

- npm: https://www.npmjs.com/package/cloud-build-cache
- Repository: https://github.com/thdk/cloud-build-cache
- Homepage: https://github.com/thdk/cloud-build-cache#readme
- Issues: https://github.com/thdk/cloud-build-cache/issues
- npm.io page: https://npm.io/package/cloud-build-cache

## Dependencies (6)

- [del](https://npm.io/package/del.md) ^6.0.0
- [tar](https://npm.io/package/tar.md) ^6.0.5
- [commander](https://npm.io/package/commander.md) ^6.2.0
- [queue-promise](https://npm.io/package/queue-promise.md) ^2.1.0
- [package-changed](https://npm.io/package/package-changed.md) ^1.5.0
- [@google-cloud/storage](https://npm.io/package/@google-cloud/storage.md) ^5.4.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.3.9 (latest) — 2020-11-09
- 0.3.8 — 2020-11-09
- 0.3.7 — 2020-11-09
- 0.3.6 — 2020-11-09
- 0.3.5 — 2020-11-09
- 0.3.4 — 2020-11-09
- 0.3.3 — 2020-11-09
- 0.3.2 — 2020-11-09
- 0.3.1 — 2020-11-09
- 0.3.0 — 2020-11-09
- 0.2.0 — 2020-11-08
- 0.1.1 — 2020-11-08
- 0.1.0 — 2020-11-08

## README

# cloud-build-cache

Cache folders such as node_modules in gcs and restore them on next builds.

**NOTE: If you are using `npm install` in your projects and are looking to speed up your CI/CD build process you should first look at using `npm ci`.**


## Install

You can find this package on `npm`.

`npm install cloud-build-cache`

## Example usage

**Node**

```javascript
const {
  installPackage,
} = require("cloud-build-cache");

installPackage({
    bucketName: 'my-project-build-cache',
    storageOptions: {
        keyFilename: path.resolve(__dirname, '../service-account.json'),
    },
});
```

**CLI**

```
Usage: cloud-build-cache [options] [command]

Options:
  -h, --help         display help for command

Commands:
  install [options]  Fetch node_modules from cloud storage bucket before installing the package.
  help [command]     display help for command


Usage: cloud-build-cache install [options]

Fetch node_modules from cloud storage bucket before installing the package.

Options:
  --bucket <name>      Name of google cloud storage bucket. Used as cache location.
  --cwd [cwd]          Current working directory.
  --key <keyFilename>  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.
```

---
_Source: https://npm.io/package/cloud-build-cache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
