2.0.4 • Published 8 years ago

tempfile2 v2.0.4

Weekly downloads
22
License
MIT
Repository
github
Last release
8 years ago

tempfile2

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Gratipay

Get a random temp file path. much better. Compatible with tempfile.

Install

npm install tempfile2 --save

Usage

var tempfile2 = require('tempfile2');

tempfile({ext:'.png'});
//=> /var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/4049f192-43e7-43b2-98d9-094e6760861b.png

tempfile({path: '/my/custom/path/', ext:'.png'});
//=> /my/custom/path/4546h192-42b1-43b2-41d9-023e6730432c.png

tempfile('.png');
//=> /var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/25c24272-2269-11e5-a17f-82bd40254040.png

API

tempfile(options)

options.path

Type: string

Optionally supply the root path. By default uses os temp dir.

options.name

Type: string

Optionally supply the file name. by default uses a unique file name based in uuid v4 algorithm

options.ext

Type: string

Optionally supply an extension to append to the path.

If options is a string, then it is assumed to be the extension.

Related

  • create-temp-file2 – Creates a temporary file, returns a write stream, a path, and cleanup functions.

License

MIT © Kiko Beats

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago