|
@@ -7,10 +7,19 @@ Object subclass: #WriteFile
|
|
|
|
|
|
main
|
|
|
| fs |
|
|
|
+
|
|
|
console log: 'Writing a file called "message.txt".'.
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ "get access to the nodejs file system library"
|
|
|
+
|
|
|
fs := require value: 'fs'.
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ "use a fs api function http://nodejs.org/api/fs.html"
|
|
|
+
|
|
|
fs writeFileSync: 'message.txt' content: 'This file was written by Amber.'
|
|
|
errFn: nil.
|
|
|
|