Skip to content

Instantly share code, notes, and snippets.

@pierophp
Last active October 3, 2016 13:39
Show Gist options
  • Save pierophp/e038f417c3bde68cf122ce7bd4c6314a to your computer and use it in GitHub Desktop.
Save pierophp/e038f417c3bde68cf122ce7bd4c6314a to your computer and use it in GitHub Desktop.
sudo npm i -g node-nightly
npm i bluebird
node-nightly --harmony_async_await async_await.js
let fs = require('fs');
let Promise = require('bluebird');
Promise.promisifyAll(fs);
async function test(){
let test = await fs.readFileAsync('test.txt', {});
console.log(test.toString());
}
test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment