Analysis updated 2026-07-18 · repo last pushed 2026-05-27
Save an uploaded file to a temp path, convert it, serve the result, then delete the temp file automatically.
Create a temporary directory for a test suite that disappears once the tests finish.
Stage intermediate files in a build tool or data pipeline without manually managing cleanup.
Generate a guaranteed-unique file or directory name without any risk of collision between processes.
| raszi/node-tmp | gaearon/react-transform-hmr | gaearon/todos | |
|---|---|---|---|
| Stars | 773 | 768 | 785 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2026-05-27 | 2018-03-21 | 2020-06-10 |
| Maintenance | Maintained | Dormant | Dormant |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
When a program needs a scratchpad, somewhere to stash a file for a few seconds, process it, and throw it away, it needs a temporary file or folder. This library, called Tmp, handles that for applications built on Node.js. It creates uniquely named files and directories, gives your program the path to use them, and can optionally clean them up automatically when your program finishes. Under the hood, it uses random characters (via cryptography when available) to generate names, so there's virtually no chance of two parts of your program accidentally grabbing the same file. You can ask it for a temporary file, a temporary directory, or just a unique name without actually creating anything. It works asynchronously (your program keeps running while it waits) or synchronously (your program pauses until the file is ready). You can also customize things like file extensions, naming prefixes, and where on your computer the files get created. Who uses this? Any developer building a Node.js application that needs short-lived storage. For example, if you're building a tool that converts uploaded images from one format to another, you might save the original to a temp file, do the conversion, serve the result, then delete the temp file. Or if you're writing test suites, you might create a temporary directory, run tests against files inside it, and have it all disappear when the tests finish. It's also common in build tools and data pipelines that need a place to stage intermediate results. One notable feature is "graceful cleanup", a single call tells the library to automatically remove every temporary file and directory it created when your program exits, so you don't leave junk scattered across the system. You can also take manual control, choosing to keep files around or force-remove directories even if they still contain items. The project has been around long enough to be one of the most depended-upon packages in the Node.js ecosystem, and it recently dropped some older dependencies to stay lean.
A Node.js library that creates uniquely named temporary files and directories, with automatic cleanup when your program exits.
Mainly JavaScript. The stack also includes Node.js, JavaScript.
Maintained — commit in last 6 months (last push 2026-05-27).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.