Bachir Soussi Chiadmi ac58a24f5c added bower, gulp | 7 years ago | |
---|---|---|
.. | ||
node_modules | 7 years ago | |
index.js | 7 years ago | |
package.json | 7 years ago | |
readme.md | 7 years ago |
Write String/Buffer to a random temp file
Install with npm
npm install --save temp-write
var fs = require('fs');
var tempWrite = require('temp-write');
var filePath = tempWrite.sync('unicorn');
//=> /var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/4049f192-43e7-43b2-98d9-094e6760861b
fs.readFileSync(filePath, 'utf8');
//=> unicorn
Type: String
|Buffer
Type: Function
Type: String
|Buffer
Returns: the file path
MIT © Sindre Sorhus