Skip to content

Commit

Permalink
docs: fix readme examples (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Aug 22, 2022
1 parent 10f8420 commit 2718347
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2718347

Please sign in to comment.