Onetime
Ensures a function runs only once, caching the first result for later calls, with support for preserving arguments and async functions, used to guard initialization, cleanup and one-shot callbacks in libraries.
Onetime at github.com/sindresorhus/onetime is a free MIT once-only function wrapper for JavaScript, npm onetime 8.0.0 Node.js >= 22, caches the first result for later calls with argument preservation and async support to guard initialization cleanup and one-shot callbacks in libraries, no sold commercial tier (data as of Nov 22, 2026).
*This is an affiliate link, we may earn a commission at no extra cost to you.
Is Onetime free?
Onetime: Onetime is free open-source software released under the MIT License; the onetime package latest 8.0.0 on npm requires Node.js >= 22. It wraps a function so the first call executes the original and later calls return the cached result, with support for argument preservation and async functions, which guards initialization, cleanup and one-shot callbacks inside reusable libraries. No paid commercial edition or per-seat license is sold by the project (data as of Nov 22, 2026). Check the official page for current status before relying on it.
Frequently Asked Questions
Is Onetime free?
The code is free to self-host, but a hosted plan from the vendor may not be. Onetime publishes its source, so cost depends on where you run it.
How much does Onetime cost?
Onetime is free open-source software released under the MIT License; the onetime package latest 8.0.0 on npm requires Node.js >= 22. It wraps a function so the first call executes the original and later calls return the cached result, with support for argument preservation and async functions, which guards initialization, cleanup and one-shot callbacks inside reusable libraries. No paid commercial edition or per-seat license is sold by the project (data as of Nov 22, 2026). Usage volume, plan limits and add-ons can push the bill above the figures shown, so confirm the current numbers on the vendor page before committing.
Where can I check Onetime's current pricing?
On Onetime's official site, linked from this page. We only publish a price after reading the vendor's own pricing page, so if this page shows no number, it means no traceable public price is on file — not that the tool is free.
What is Onetime?
The wrapper stores whether the function has run and caches its return value; subsequent invocations skip the original call and reuse the cached result, while async variants await the first promise once, so a setup or teardown step cannot accidentally execute twice.
How does pricing work?
The package installs free under MIT with no seat license; it wraps functions in-process, and commercial support would be outside the open-source project.
How does Onetime compare with other tools in Dev Workflow & Productivity?
Onetime is listed in the Dev Workflow & Productivity category, alongside 2 other tools we track here. 2 of those 2 peers have a dated price we read from the vendor's own pricing page, and the table below shows each tool's pricing model next to the exact rate on file — so the comparison is between published numbers, not between marketing pages.
| Tool | Pricing model | Key pricing on file | Price checked |
|---|---|---|---|
| Onetime | Open source | Onetime is free open-source software released under the MIT License; the onetime package latest 8.0.0 on npm requires Node.js >= 22. It wraps a function so the first call executes the original and later calls return the cached result, with support for argument preservation and async functions, which guards initialization, cleanup and one-shot callbacks inside reusable libraries. No paid commercial edition or per-seat license is sold by the project (data as of Nov 22, 2026). | Nov 22, 2026 |
| Execa | Open source | Execa is free open-source software released under the MIT License; the execa package latest 10.2.1 on npm requires Node.js >= 22. It wraps child process spawning with promise-based stdout and stderr, stdio configuration, timeouts, cleanup and structured error results, so scripts and build pipelines can run CLI tools with clearer failure reporting. No paid commercial edition or per-seat license is sold by the project (data as of Nov 22, 2026). | Nov 22, 2026 |
| Get Stream | Open source | Get-stream is free open-source software released under the MIT License; the get-stream package latest 9.0.1 on npm requires Node.js >= 18. It reads a readable stream to completion and returns the content as a string or buffer, with an option to cap the maximum size, which simplifies capturing child process stdout, HTTP bodies and file streams in scripts and tests. No paid commercial edition or per-seat license is sold by the project (data as of Nov 22, 2026). | Nov 22, 2026 |
3 of these 3 entries carry a specific price we read from the vendor's site. Where the column says there is no dated price on file, we have not verified a rate — treat that as unknown rather than free, and check the vendor's page before you budget for it.
Full pricing breakdown
Onetime's source code is publicly available, so you can run or build it yourself. The project may also sell a paid hosted or cloud plan — check the official site for current pricing.
Open source does not always mean every hosted version is free.
Key pricing: Onetime is free open-source software released under the MIT License; the onetime package latest 8.0.0 on npm requires Node.js >= 22. It wraps a function so the first call executes the original and later calls return the cached result, with support for argument preservation and async functions, which guards initialization, cleanup and one-shot callbacks inside reusable libraries. No paid commercial edition or per-seat license is sold by the project (data as of Nov 22, 2026).
Estimate your monthly bill with our calculator →Or build a full stack around your budget →Pricing Guides & Comparisons
Plan prices in these guides are read from each vendor's own pricing page, with the date we checked them.
⭐ Rate this tool
How would you rate this tool?
🚀 Never Miss a New AI Coding Tool
Join 1,000+ developers getting our weekly roundup: new AI tools, student free tiers, exclusive discounts, and side project deals. No spam, unsubscribe anytime.
Current Alternatives
Execa
Enhanced child process execution wrapper for Node.js, spawning commands with promise-based output, stdio options, timeouts, cleanup and verbose error results, used to run shell commands and CLI tools from scripts and build pipelines.
Get Stream
Collects a readable stream into a string or buffer with a maximum-size guard, simplifying capture of child process stdout, HTTP response bodies and file streams in Node.js scripts and tests.
Tool Information
- Official Websitegithub.com
- CategoryDev Workflow & Productivity
- PricingOpen Source
- Price checkedNov 22, 2026
