npm.io
1.0.10 • Published 8 months ago

temp-suffix

Licence
MIT
Version
1.0.10
Deps
1
Size
8 kB
Vulns
0
Weekly
0

temp-suffix

Adds a unique suffix to a string with process and thread uniqueness guarantees. Adapted from https://github.com/npm/write-file-atomic

var tempSuffix = require(temp-suffix');
var assert = require(assert');

var tempFilename = tempSuffix(__filename);
console.log(tempFilename); // __filename + '-' + [UNIQUE SUFFIX]

var suffix = tempSuffix();
console.log(suffix); // [UNIQUE SUFFIX]

Keywords