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.

9 lines
288 B

var tmp = require("./index.js");
var Promise = require("bluebird"); // just for delay, this works with native promises
// disposer
tmp.withFile((path) => {
console.log("Created at path", path);
return Promise.delay(1000);
}).then(() => {
console.log("File automatically disposed");
});