diff --git a/README.md b/README.md index 44f2ca4..3ab5a27 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,17 @@ unique-filename Generate a unique filename for use in temporary directories or caches. -``` -var uniqueFilename = require('unique-filename') +```js +const uniqueFilename = require('unique-filename') -// returns something like: /tmp/912ec803b2ce49e4a541068d495ab570 -var randomTmpfile = uniqueFilename(os.tmpdir()) +// returns something like: '/tmp/c5b28f47' +const randomTmpfile = uniqueFilename(os.tmpdir()) -// returns something like: /tmp/my-test-912ec803b2ce49e4a541068d495ab570 -var randomPrefixedTmpfile = uniqueFilename(os.tmpdir(), 'my-test') +// returns something like: '/tmp/my-test-51a7b48d' +const randomPrefixedTmpfile = uniqueFilename(os.tmpdir(), 'my-test') -var uniqueTmpfile = uniqueFilename('/tmp', 'testing', '/my/thing/to/uniq/on') +// returns something like: '/my-tmp-dir/testing-7ddd44c0' +const uniqueTmpfile = uniqueFilename('/my-tmp-dir', 'testing', '/my/thing/to/uniq/on') ``` ### uniqueFilename(*dir*, *fileprefix*, *uniqstr*) → String