
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@lage-run/cache
Advanced tools
This package provides:
Cache
interfacebackfill
import { BackfillCacheProvider, RemoteFallbackCacheProvider, TargetHasher } from "@lage-run/cache";
const cacheOptions = {
internalCacheFolder: ".cache",
outputGlob: ["dist/**", "lib/**"]
}
const root = getWorkspaceRoot(cwd);
const remoteFallbackCacheProviderOptions = {
root,
localCacheProvider: cacheOptions.skipLocalCache ? undefined : new BackfillCacheProvider({
root,
cacheOptions: {
outputGlob: ["dist/**"]
}
}),
remoteCacheProvider: new BackfillCacheProvider({
root,
{
cacheStorageOptions: {
provider: "azure-blob",
options: {
connectionString: "asdfasdfasdfafds"; // Providing an un-authenitcated Blob Service Endpoint will force use of Azure EnvironmentCredential
container: "container";
maxSize?: 150;
credentialName?: "environment-credential" // Default value or ignored if connectionString carries credentials
}
},
...cacheOptions
writeRemoteCache: true,
outputGlob: ["dist/**", "lib/**"]
},
isReadOnly: cacheOptions.writeRemoteCache !== true,
})
}
const cacheProvider = new RemoteFallbackCacheProvider(remoteFallbackCacheProviderOptions);
const hasher = new TargetHasher({
root,
environmentGlob: ["lage.config.js"],
cacheKey: "some cache key",
})
let hash: string | null = null;
let cacheHit = false;
if (target.cache && !skipCaching) {
hash = await hasher.hash(target, cliArgs);
if (hash && !shouldResetCache) {
cacheHit = await cacheProvider.fetch(hash, target);
}
}
// DO TARGET RUN ACTIONS
// ...
await cacheProvider.put(hash, target);
To specifically differentiate the hash generated for the cache, between different steps the parameter cacheKey
can be used. The parameter will be a part of the hash generation for the cache, and generated hash can be altered by modifying the parameter.
Add the parameter in your lage.config.js
as follows
{
cacheOptions: {
cacheKey: "some cache key";
}
}
FAQs
Cache for Lage
The npm package @lage-run/cache receives a total of 243 weekly downloads. As such, @lage-run/cache popularity was classified as not popular.
We found that @lage-run/cache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.