You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 997B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # tempfile [![Build Status](https://travis-ci.org/sindresorhus/tempfile.svg?branch=master)](https://travis-ci.org/sindresorhus/tempfile)
  2. > Get a random temporary file path
  3. **Checkout out [`tempy`](https://github.com/sindresorhus/tempy) which is better take on this module.**
  4. ## Install
  5. ```
  6. $ npm install --save tempfile
  7. ```
  8. ## Usage
  9. ```js
  10. const tempfile = require('tempfile');
  11. tempfile('.png');
  12. //=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/4049f192-43e7-43b2-98d9-094e6760861b.png'
  13. tempfile();
  14. //=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/6271e235-13b9-4138-8b9b-ee2f26c09ce3'
  15. ```
  16. ## API
  17. ### tempfile([extension])
  18. #### extension
  19. Type: `string`
  20. Extension to append to the path.
  21. ## Related
  22. - [tempy](https://github.com/sindresorhus/tempy) - Get a random temporary file or directory path
  23. - [temp-write](https://github.com/sindresorhus/temp-write) - Write string/buffer/stream to a random temp file
  24. ## License
  25. MIT © [Sindre Sorhus](https://sindresorhus.com)