0.1.3 • Published 4 years ago

unique-temp-path v0.1.3

Weekly downloads
20
License
MIT
Repository
-
Last release
4 years ago

unique-temp-path

Create temporary directory/file names that are unique

Requirements

  • Node.js ≥ 8.9.0

Why?

There're always files/directories being added to temporary directory. There's a chance, albeit rather small, that a random string would collapse with them. For this reason, it is necessary to check whether that random name exists.

Usage

Function Signature

declare function tempPath (prefix?: string, suffix?: string): string

Example

import tempPath from 'unique-temp-path'
import fs from 'fs'
const filename = tempPath('myprefix', 'mysuffix')
fs.writeFileSync(filename, 'This is temporary')

A file with name of myprefix{{random string}}mysuffix would be created.

License

MIT © Hoàng Văn Khải

0.1.3

4 years ago

0.1.2

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago