
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
mktemp command for node.js
$ npm install mktemp
var mktemp = require('mktemp');
mktemp.createFile('XXXXX.txt', function(err, path) {
if (err) throw err;
// path match a /^[\da-zA-Z]{5}\.txt$/
console.log(path);
});
// return value match a /^[\da-zA-Z]{5}\.tmp$/
mktemp.createFileSync('XXXXX.tmp');
mktemp.createDir('XXXXXXX', function(err, path) {
if (err) throw err;
// path match a /^[\da-zA-Z]{7}$/
console.log(path);
});
// return value match a /^XXX-[\da-zA-Z]{3}$/
mktemp.createDirSync('XXX-XXX');
if support Promise, can use Promise style.
var mktemp = require('mktemp');
mktemp
.createFile('XXXXX.txt')
.then(function(path) {
// path match a /^[\da-zA-Z]{5}\.txt$/
console.log(path);
})
.catch(function(err) {
console.error(err);
});
mktemp
.createDir('XXXXX')
.then(function(path) {
// path match a /^[\da-zA-Z]{5}$/
console.log(path);
})
.catch(function(err) {
console.error(err);
});
mktemp functions are replace to random string from placeholder "X" in template. see example:
mktemp.createFileSync('XXXXXXX'); // match a /^[\da-zA-Z]{7}$/
mktemp.createFileSync('XXX.tmp'); // match a /^[\da-zA-Z]{3}\.tmp$/
mktemp.createFileSync('XXX-XXX'); // match a /^XXX-[\da-zA-Z]{3}$/
template
String
- filename templatecallback
function(err, path)
- callback function
err
: Error|Null
- error objectpath
: String
- pathcreate blank file of unique filename. permission is 0600
.
it throws TypeError if node.js unsupported Promise and callback is not a function.
template
String
- filename templatereturn
String
- pathsync version createFile.
template
String
- dirname templatecallback
function(err, path)
- callback function
err
: Error|Null
- error objectpath
: String
- pathcreate directory of unique dirname. permission is 0700
.
it throws TypeError if node.js unsupported Promise and callback is not a function.
template
String
- dirname templatereturn
String
- pathsync version createDir.
The MIT license.
FAQs
mktemp command for node.js
The npm package mktemp receives a total of 246,998 weekly downloads. As such, mktemp popularity was classified as popular.
We found that mktemp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.