# tmp (Node.js)

> Temporary file and directory creator for Node.js

Source: https://talira.ai/catalog/tmp-node-js-4et6gth2
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / filesystem](https://talira.ai/categories/libraries/filesystem), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^3]
- Pricing: Free and open source[^2]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^2]
- Backed by: [KARASZI István](https://talira.ai/orgs/karaszi-istvan.md)

tmp creates temporary files and directories in Node.js, with asynchronous and synchronous APIs whose parameters are all optional. It picks random names with crypto, or a six-letter random identifier when you give a template, and can remove the files when the process exits. You can also point it at a temporary directory other than the system's. A promise-based wrapper, tmp-promise, is a separate package.

## Links

- GitHub: https://github.com/raszi/node-tmp
- Docs: https://raszi.github.io/node-tmp/

## Problems it solves

- create a temporary file in Node.js that's cleaned up when the process exits
- make a unique temporary directory for a test in Node.js
- get a safe random temp file name without collisions

## Features

- temporary files and directories, async and sync APIs
- random names from crypto, or templates with a six-letter random identifier
- optional removal on process exit
- a custom temporary directory instead of the system one

## Limitations

- Needs Node.js 14.14 or newer.[^1]

## Trust

Overall: 0.34 out of 1.
Signals: maintenance 0.27, adoption 0.58, momentum 0.22, community 0.64, backing 0.30, extensibility 0.00.

- 776 GitHub stars
- 39 contributors
- backed by KARASZI István

Warnings:

- last commit 6 months ago

## Alternatives

- [rimraf](https://talira.ai/catalog/rimraf-dg86ye06.md): rm -rf for Node.js, cross-platform
- [del](https://talira.ai/catalog/del-x22je8ym.md): Delete files and directories by glob in Node.js, with a promise API
- [fs-extra](https://talira.ai/catalog/fs-extra-7eajtfgm.md): Node.js fs with recursive mkdir, copy, remove and promises

## Sources

[^1]: https://github.com/raszi/node-tmp/blob/master/package.json (checked 29 Nov 2026)
[^2]: https://github.com/raszi/node-tmp/blob/master/README.md (checked 29 Nov 2026)
[^3]: https://github.com/raszi/node-tmp/blob/master/LICENSE (checked 29 Nov 2026)
