WebFund 2015W: Tutorial 5

From Soma-notes
Revision as of 13:05, 23 February 2015 by Soma (talk | contribs) (Created page with "In today's tutorial you'll be making a simple program, <tt>insertNote.js</tt> that can be run as follows: node insertNote.js <author> <title> <file with note contents> Whe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In today's tutorial you'll be making a simple program, insertNote.js that can be run as follows:

 node insertNote.js <author> <title> <file with note contents>

When you type the command

 node insertNote.js Anil "My first note" firstnote.txt

it creates a note with the title "My first note", authored by "Anil", with the contents of the note being the contents of the file "firstnote.txt".

You should base you code on the following code:

* storeNotes.js
* fileStats.js

Note that in order to get storeNotes.js to run you will need to do the following first in the directory where storeNotes.js is:

npm install mongodb