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

unique-filename

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unique-filename - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

.nyc_output/54942.json

8

package.json
{
"name": "unique-filename",
"version": "1.0.0",
"version": "1.1.0",
"description": "Generate a unique filename for use in temporary directories or caches.",

@@ -21,8 +21,8 @@ "main": "index.js",

"devDependencies": {
"standard": "^3.7.3",
"tap": "^1.0.0"
"standard": "^5.4.1",
"tap": "^2.3.1"
},
"dependencies": {
"unique-slug": "^1.0.0"
"unique-slug": "^2.0.0"
}
}

@@ -21,4 +21,4 @@ unique-filename

Returns the full path of a unique filename that looks like:
`dir/prefix-912ec803b2ce49e4a541068d495ab570`
or `dir/912ec803b2ce49e4a541068d495ab570`
`dir/prefix-7ddd44c0`
or `dir/7ddd44c0`

@@ -25,0 +25,0 @@ *dir* – The path you want the filename in. `os.tmpdir()` is a good choice for this.

@@ -8,3 +8,3 @@ 'sue strict'

var randomTmpfile = uniqueFilename('tmp')
t.like(randomTmpfile, /^tmp.[a-f0-9]{32}$/, 'random tmp file')
t.like(randomTmpfile, /^tmp.[a-f0-9]{8}$/, 'random tmp file')

@@ -15,3 +15,3 @@ var randomAgain = uniqueFilename('tmp')

var randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test')
t.like(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{32}$/, 'random prefixed tmp file')
t.like(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{8}$/, 'random prefixed tmp file')

@@ -22,5 +22,5 @@ var randomPrefixedAgain = uniqueFilename('tmp', 'my-test')

var uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on')
t.like(uniqueTmpfile, /^tmp.testing-dd1ecbb112056bb8a7347e852ce3ddf9$/, 'unique filename')
t.like(uniqueTmpfile, /^tmp.testing-7ddd44c0$/, 'unique filename')
var uniqueAgain = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on')
t.is(uniqueTmpfile, uniqueAgain, 'same unique string component produces same filename')
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