Skip to content

Instantly share code, notes, and snippets.

@aliceklipper
Last active February 25, 2017 14:52
Show Gist options
  • Save aliceklipper/80c5deba73d6a43244ad6e1ceaa21550 to your computer and use it in GitHub Desktop.
Save aliceklipper/80c5deba73d6a43244ad6e1ceaa21550 to your computer and use it in GitHub Desktop.
Read text from file
from fs import readFile as read
from console import print
async main () : I32
let file = await read('hello.txt') # `file`'s type inferred as Buffer
print('File contents: `file`') # `file` converted to string using implicit `toString()` method invocation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment