Last active
February 25, 2017 14:52
-
-
Save aliceklipper/80c5deba73d6a43244ad6e1ceaa21550 to your computer and use it in GitHub Desktop.
Read text from file
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
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