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.

example-usage.js 288B

123456789
  1. var tmp = require("./index.js");
  2. var Promise = require("bluebird"); // just for delay, this works with native promises
  3. // disposer
  4. tmp.withFile((path) => {
  5. console.log("Created at path", path);
  6. return Promise.delay(1000);
  7. }).then(() => {
  8. console.log("File automatically disposed");
  9. });