Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via pnpm

temp 0.6.0

Temporary files and directories
Package summary
Share
6
issues
1
critical severity
license
1
3
high severity
license
2
meta
1
2
low severity
license
2
3
licenses
2
BSD
1
MIT
1
N/A
Package created
9 Nov 2010
Version published
9 Sep 2013
Maintainers
2
Total deps
4
Direct deps
2
License
UNKNOWN

Issues

6

1 critical severity issue

critical
Recommendation: Check the package code and files for license information
via: temp@0.6.0
Collapse
Expand

3 high severity issues

high
Recommendation: Validate that the package complies with your license policy
via: rimraf@2.1.4
Recommendation: Validate that the package complies with your license policy
via: osenv@0.0.3
via: rimraf@2.1.4
Collapse
Expand

2 low severity issues

low
Recommendation: Read and validate the license terms
via: rimraf@2.1.4
Recommendation: Read and validate the license terms
via: osenv@0.0.3
Collapse
Expand

Licenses

BSD

Invalid
Not OSI Approved
2 Packages, Including:
graceful-fs@1.2.3
osenv@0.0.3

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
1 Packages, Including:
rimraf@2.1.4

N/A

N/A
1 Packages, Including:
temp@0.6.0
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

2
All Dependencies CSV
β“˜ This is a list of temp 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
osenv0.0.33.4 kBBSD
prod
1
1
rimraf2.1.43.22 kBMIT
prod
2
1

Visualizations

Frequently Asked Questions

What does temp do?

The "temp" package is a versatile tool for handling temporary files, directories, and streams in Node.js. It is specially engineered to generate unique file or directory names under the system's temporary directory, change the file mode accordingly, and even provide automatic removal of the temporary entities if needed. This package offers a similar API to the Node.js 'fs' module and is well-suited to the demands of scripts, task runners like Grunt, and even long-running server processes.

How do you use temp?

Utilizing "temp" involves the use of different methods depending on the nature of your task. If you want to create a temporary file, the open or openSync method can be used with optional prefix, suffix, or both. A temporary directory can be created using mkdir or mkdirSync, or you can use path to get a unique name in the system temporary directory. If you want to track the temporary files and directories for automatic cleanup, call the track method. To trigger cleanup at any time, use cleanup or cleanupSync. Below are some examples to illustrate these methods:

For creating and writing to a temporary file and cleaning it up automatically:

var temp = require('temp'),
    fs   = require('fs');

temp.track();

var myData = "sample data";

temp.open('myprefix', function(err, info) {
  fs.write(info.fd, myData, (err) => {
		console.log(err);
	});
  fs.close(info.fd, function(err) {
    // do something with the file
  });
});

For creating a temporary directory:

var temp = require('temp'),
    fs   = require('fs'),
    path = require('path'),

temp.track();

var myData = "Hello World";

temp.mkdir('mydir', function(err, dirPath) {
  fs.writeFile(path.join(dirPath, 'myfile.txt'), myData, function(err) {
    // do something with the file
  });
});

Where are the temp docs?

The documentation for "temp" is encompassed in the package's README content. It provides comprehensive detail about the package's functionalities, methods, affixes handling, and examples to guide you. For more information, you can visit the official GitHub repository at 'http://github.com/bruce/node-temp'. Please make sure to review the examples directory, as it contains working copies of the example usage provided in the readme.