Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 24, 2024 via pnpm

tmp 0.2.1

Temporary file and directory creator
Package summary
Share
0
issues
2
licenses
8
ISC
5
MIT
Package created
2 Sep 2011
Version published
29 Apr 2020
Maintainers
1
Total deps
13
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
8 Packages, Including:
fs.realpath@1.0.0
glob@7.2.3
inflight@1.0.6
inherits@2.0.4
minimatch@3.1.2
once@1.4.0
rimraf@3.0.2
wrappy@1.0.2

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
balanced-match@1.0.2
brace-expansion@1.1.11
concat-map@0.0.1
path-is-absolute@1.0.1
tmp@0.2.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of tmp 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
rimraf3.0.26.33 kBISC
prod

Visualizations

Frequently Asked Questions

What does tmp do?

Tmp is an easy-to-use and efficient library for creating temporary files and directories in a Node.js environment. The package offers both asynchronous and synchronous API and maintains compatibility with promisified versions of the API as seen in tmp-promise. Notably, Tmp uses crypto libraries for random file name generation to assure file uniqueness, hence reducing conflict chances. It provides the flexibility of choosing to remove the temporary file on process exit or not, and the options to override the standard OS temporary directory for storing your temporary directories and files.

How do you use tmp?

Tmp package is used by installing it from npm by running npm install tmp. Once installed, you can import it in your Javascript file using const tmp = require('tmp');. To create a temporary file asynchronously, for instance, you would use:

const tmp = require('tmp');

tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) {
  if (err) throw err;

  console.log('File: ', path);
  console.log('Filedescriptor: ', fd);
  
  cleanupCallback();
});

Or synchronously:

const tmp = require('tmp');

const tmpobj = tmp.fileSync();
console.log('File: ', tmpobj.name);
console.log('Filedescriptor: ', tmpobj.fd);
  
tmpobj.removeCallback();

Tmp provides countless more functionalities beyond just creating temporary files including temporary directory creation, filename generation, and more with both synchronous and asynchronous implementations, offering flexibility and power in managing temporary files and directories in Node.js.

Where are the tmp docs?

The Tmp package offers comprehensive and elaborate documentation, including in-depth usage examples and advanced features on the dedicated Tmp documentation page. The documentation provides clear guidelines on the installation and usage of the package, option configurations, and the usage of the API available on the Tmp library. Whether you're a beginner or a seasoned developer, every aspect of Tmp for Node.js can be found in this resource.