Browse Source

Upd comments for writefile

hhzl 9 years ago
parent
commit
4289f4bf15
2 changed files with 11 additions and 1 deletions
  1. 2 1
      nodejs/README.md
  2. 9 0
      nodejs/writefile/WriteFile.st

+ 2 - 1
nodejs/README.md

@@ -12,9 +12,10 @@ To run these examples do
     grunt amberc:trivialserver
     grunt amberc:pystone
     grunt amberc:meta	
-
+    grunt amberc:writefile
 
 - **hello** Hello world example with a simple Makefile.
+- **writefile** Shows how to use the nodejs fs library.
 - **benchfib** Port of tinybenchmarks from Squeak.
 - **trivialserver** A slightly larger example.
 

+ 9 - 0
nodejs/writefile/WriteFile.st

@@ -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.