Last active
October 3, 2016 13:39
-
-
Save pierophp/e038f417c3bde68cf122ce7bd4c6314a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo npm i -g node-nightly | |
npm i bluebird | |
node-nightly --harmony_async_await async_await.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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