Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tempy

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tempy - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

index.d.ts

23

index.js

@@ -9,22 +9,23 @@ 'use strict';

module.exports.file = opts => {
opts = Object.assign({
extension: ''
}, opts);
module.exports.file = options => {
options = {
extension: '',
...options
};
if (opts.name) {
if (opts.extension) {
if (options.name) {
if (options.extension) {
throw new Error('The `name` and `extension` options are mutually exclusive');
}
return path.join(module.exports.directory(), opts.name);
return path.join(module.exports.directory(), options.name);
}
return getPath() + (opts.extension ? `.${opts.extension.replace(/^\./, '')}` : '');
return getPath() + '.' + options.extension.replace(/^\./, '');
};
module.exports.directory = () => {
const dir = getPath();
fs.mkdirSync(dir);
return dir;
const directory = getPath();
fs.mkdirSync(directory);
return directory;
};

@@ -31,0 +32,0 @@

{
"name": "tempy",
"version": "0.2.1",
"version": "0.3.0",
"description": "Get a random temporary file or directory path",

@@ -13,13 +13,13 @@ "license": "MIT",

"engines": {
"node": ">=4"
"node": ">=8"
},
"scripts": {
"test": "xo && ava"
"test": "xo && ava && tsd"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"keywords": [
"temp",
"tmp",
"temporary",

@@ -29,3 +29,2 @@ "path",

"directory",
"dir",
"folder",

@@ -37,3 +36,2 @@ "tempfile",

"random",
"rand",
"unique",

@@ -44,8 +42,10 @@ "uniq"

"temp-dir": "^1.0.0",
"type-fest": "^0.3.1",
"unique-string": "^1.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc