
Product
A New Overview in our Dashboard
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
memo-again
Advanced tools
Two-level memoizer
with promises stores function values in memory and/or file caches.
Writes to memory and file caches can be independently
changed on demand.
The file cache is stored in the application local
folder
by default, so you may want to add local/
to .gitignore
.
For more examples, see test/memoizer.js
const { Memoizer } = require("memo-again");
var f = x=>42+x;
var mzr = new Memoizer();
var fmemo = mzr.memoize(f);
fmemo(0); // 42
fmemo(0); // 42 (cached)
fmemo(1); // 43
fmemo(1); // 43 (cached)
File iterators and more...
Async generator permits precise control of thread usage.
var files = [];
for await (let f of Files.files(FILES_DIR)) {
files.unshift(f);
}
// [ "hello", "sub/basement", "universe", ]
Async generator provides fs.Stats
var opts = {
root: FILES_DIR,
stats: true, // return fs.Stats object
absolute: true, // return absolute filepath
}
for await (let f of Files.files(FILES_DIR)) {
console.log(JSON.stringify(f));
// {path:..., stats:...}
}
Sync generator uses fs sync methods and can be slower.
var files = [...Files.filesSync(FILES_DIR)];
// [ "hello", "sub/basement", "universe", ]
The application that uses this library
console.log(Files.APP_DIR);
// /home/somebody/myapp
Use "local" folder for application data.
Remember to add it to .gitignore
console.log(Files.LOCAL_DIR);
// /home/somebody/myapp/local
FAQs
Serializable memoizer with promises
We found that memo-again demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.