Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
nx-remotecache-custom
Advanced tools
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:
and createCustomRunner()
is taking care of everything else. Not convinced yet? The package will also:
Nx | Remote Cache |
---|---|
>= 17.0.0 < 18 | >= 17.0.0 < 18 |
>= 16.9.0 < 17 | >= 5.0.0 < 17 |
< 16.9.0 | < 5.0.0 |
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.
Option | Environment Variable / .env | Description |
---|---|---|
name | NXCACHE_NAME | Set to provide task runner name for logging. Overrides name provided in implementation. |
verbose | Set to receive full stack traces whenever errors occur. Best used for debugging. Default: false | |
silent | Set to mute success and info logs. Default: false | |
read | NXCACHE_READ | Set to enable / disable reading from the remote cache. Default: true |
write | NXCACHE_WRITE | Set to enable / disable writing to the remote cache. Default: true |
dotenv | Set to false to disable reading .env into process.env . Default: true | |
dotenvPath | Set to read .env files from a different folder. |
"tasksRunnerOptions": {
"default": {
"options": {
"name": "My Storage",
"verbose": true,
"silent": true
}
}
}
Runner | Storage |
---|---|
nx-remotecache-azure | Azure Blob Storage |
nx-remotecache-minio | MinIO Storage |
18.0.0
skipLibCheck: true
inside the tsconfig.json
of nx-remotecache-*
packages.FAQs
Build custom caching for @nrwl/nx in a few lines of code
The npm package nx-remotecache-custom receives a total of 89,723 weekly downloads. As such, nx-remotecache-custom popularity was classified as popular.
We found that nx-remotecache-custom demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.