Back to Trending
RepositoryTypeScriptDEGermany
NiklasPor

NiklasPor/nx-remotecache-custom

Build custom caching for @nrwl/nx in a few lines of code

168stars
29forks
9issues
3views

Static Badge https://www.npmjs.com/package/nx-remotecache-custom Downloads Sponsored by LastBIM

The future of nx-remotecache-*

Nrwl Nx just introduced us to Powerpack. It's the clear successor of the remote cache setup and officially supports custom caching solutions. This will mark the end of the nx-remotecache-* packages as custom caching solutions based on the filesystem won't work anymore starting with Nx 21.

Powerpack fills exactly the void that nx-remotecache-custom filled. Therefore I'm happy to give this topic back to the creators behind Nx. Thanks for the great ride – we reached over 114,000 weekly downloads on npm as I'm writing this 🥳

Feel free to read the Introduction to Powerpack by Jeff yourself. If you have any further questions checkout the pinned GitHub issue.

Cheers, Niklas 👋

Critical Vulnerability: CVE-2025-36852

Due to the way remote caching with shared buckets works, cache poisoning is possible via anything that runs pipelines on untrusted code (e.g. a pull request). You can read-up on the vulnerability in this document from NX or here on nist. There's no planned fix for this vulnerability. I still recommend to use the official solution powerpack by Nx instead.

nx-remotecache-custom

nx-remotecache-custom is a simple package which includes a helper function to create custom nx remote cache implementations. You'll only need to add functions for:

  1. storing a file / buffer
  2. retrieving a file / buffer
  3. checking if a file / buffer exists

and createCustomRunner() is taking care of everything else. Not convinced yet? The package will also:

  • Print beautiful & colored nx-style messages to the console 💅🎆
  • Allow you to execute asynchronous code in the setup phase of your runner 🤖
  • Handle all thrown errors ➡ No broken builds to offline remote caches 🚀
  • Automagically zip all the cached files ➡ Minimal storage & traffic consumption 📦
  • Provide a small defined and documented API 📚

Compatability

 NxRemote Cache
 >= 21Deprecated
 >= 20.0.0 < 21>= 20.0.0
 >= 19.0.0 < 20>= 19.0.0 < 20
 >= 18.0.0 < 19>= 18.0.0 < 19
 >= 17.0.0 < 18>= 17.0.0 < 18
 >= 16.9.0 < 17>= 5.0.0 < 17
 < 16.9.0< 5.0.0

Usage

npm i nx-remotecache-custom
// define custom parameters for your nx.json here
interface MyRunnerOptions {
  remoteUrl: string;
}

export default createCustomRunner<MyRunnerOptions>(async (options) => {
  // initialize environment variables from dotfile
  initEnv(options);

  // initialize the connection to your remote storage here
  const myStorage = new MyStorage(options.remoteUrl);

  return {
    // name is used for logging purposes
    name: "My Storage",

    // fileExists checks whether a file exists on your remote storage
    fileExists: (filename) => myStorage.exists(filename),

    // retrieveFile downloads a file from your remote storage
    retrieveFile: (filename) => myStorage.download(filename),

    // storeFile uploads a file from a buffer to your remote storage
    storeFile: (filename, buffer) => myStorage.upload(filename, buffer),
  };
});
{
  "name": "nx-remotecache-mystorage",
  "main": "index.js"
}

After this your package is already ready for usage. Publish it to npm (or an internal registry) and consume it in your client library. Install it and adjust your nx.json to use the newly created runner:

"tasksRunnerOptions": {
  "default": {
    "runner": "nx-remotecache-mystorage",
    "options": {
      "remoteUrl": "http://127.0.0.1:1337",
      "cacheableOperations": ["build", "test", "lint", "e2e"]
    }
  }
}

For a more in-depth code example you can take a look at the implementation of nx-remotecache-azure which uses this package to implement a nx cache on the Azure Blob Storage.

Advanced Configuration

OptionEnvironment Variable / .envDescription
nameNXCACHE_NAMESet to provide task runner name for logging. Overrides name provided in implementation.
verboseSet to receive full stack traces whenever errors occur. Best used for debugging. Default: false
silentSet to mute success and info logs. Default: false
readNXCACHE_READSet to enable / disable reading from the remote cache. Default: true
writeNXCACHE_WRITESet to enable / disable writing to the remote cache. Default: true
dotenvSet to false to disable reading .env into process.env. Default: true
dotenvPathSet to read .env files from a different folder.
"tasksRunnerOptions": {
  "default": {
    "options": {
      "name": "My Storage",
      "verbose": true,
      "silent": true
    }
  }
}

All Custom Runners

RunnerStorage
nx-remotecache-azure Azure Blob Storage
@pellegrims/nx-remotecache-s3 S3 Storage
nx-remotecache-minio MinIO Storage
@vercel/remote-nxVercel Cache
nx-remotecache-redisRedis Cache

... and many more!

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
nrwl/nx

The Monorepo Platform that amplifies both developers and AI agents. Nx optimizes your builds, scales your CI, and fixes failed PRs automatically. Ship in half the time.

29.5k
Nov 26, 2026
RepositoryTypeScript
nxrs/cargo

@nrwl/nx plugin adding support for Rust.

118
May 10, 2024
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryTypeScript
excalidraw/excalidraw

Virtual whiteboard for sketching hand-drawn like diagrams

136.5k
Nov 28, 2026
RepositoryPython
EbookFoundation/free-programming-books

:books: Freely available programming books

403.1k
Nov 30, 2026
RepositoryGo
avelino/awesome-go

A curated list of awesome Go frameworks, libraries and software

197.2k
Dec 2, 2026
RepositoryGo
prometheus/prometheus

The Prometheus monitoring system and time series database.

68.1k
Dec 2, 2026
RepositorySwift
iina/iina

The modern video player for macOS.

47.4k
Dec 1, 2026
RepositoryJavaScript
remoteintech/remote-jobs

Source for remoteintech.company — a community-maintained directory of remote-friendly tech companies

41.2k
Nov 20, 2026