# node-async-once-save **Repository Path**: mirrors_emersion/node-async-once-save ## Basic Information - **Project Name**: node-async-once-save - **Description**: Execute an async function once and save the result - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-24 - **Last Updated**: 2026-07-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # node-async-once-save Execute an async function once and save the result. The async function can be any function, unlike [`async-once`](https://www.npmjs.com/package/async-once). ## Usage ```js var once = require('async-once-save'); var i = 0; var asyncFunction = once(function (j, done) { setTimeout(function () { i++; done(i, j); }, 1000); }); asyncFunction(42, function (i, j) { console.log(i, j); // 1, 42 // The function as been executed once and its result has been saved. // Another call won't wait for 1 second and will return the same result. asyncFunction(76, function (i, j) { console.log(i, j); // 1, 42 }); }); ``` ## License MIT