I am Mikhail Evdokimov, a Hobbyist Self Taught Programmer
Learning NodeJS
July
31st,
2016
Hello World
Write a program that prints the text “HELLO WORLD” to the console
Baby Steps
Write a program that accepts one or more numbers as command-line arguments
and prints the sum of those numbers to the console (stdout)
My First I/O
Write a program that uses a single synchronous filesystem operation to
read a file and print the number of newlines (\n) it contains to the
console (stdout), similar to running cat file | wc -l
The full path to the file to read will be provided as the first
command-line argument (i.e., process.argv[2]). You do not need to make
your own test file
My First Async I/O
Write a program that uses a single asynchronous filesystem operation to
read a file and print the number of newlines it contains to the console
(stdout), similar to running cat file | wc -l
The full path to the file to read will be provided as the first
command-line argument
Filtered LS
Create a program that prints a list of files in a given directory,
filtered by the extension of the files
Make it Modular
server.js
index.js
HTTP Client
Write a program that performs an HTTP GET request to a URL provided to you
as the first command-line argument. Write the String contents of each
“data” event from the response to a new line on the console (stdout)
HTTP Collect
Write a program that performs an HTTP GET request to a URL provided to you
as the first command-line argument. Collect all data from the server (not
just the first “data” event) and then write two lines to the console
(stdout)
The first line you write should just be an integer representing the number
of characters received from the server. The second line should contain the
complete String of characters sent by the server
Juggling Async
This problem is the same as the previous problem (HTTP COLLECT) in that
you need to use http.get(). However, this time you will be provided with
three URLs as the first three command-line arguments
You must collect the complete content provided to you by each of the URLs
and print it to the console (stdout). You don’t need to print out the
length, just the data as a String; one line per URL. The catch is that you
must print them out in the same order as the URLs are provided to you as
command-line arguments
Time Server
Write a TCP time server!
Your server should listen to TCP connections on the port provided by the
first argument to your program. For each connection you must write the
current date & 24 hour time in the format:
"YYYY-MM-DD hh:mm"
followed by a newline character. Month, day, hour and minute must be
zero-filled to 2 integers. For example:
"2013-07-06 17:42"
After sending the string, close the connection
HTTP File Server
Write an HTTP server that serves the same text file for each request it
receives
Your server should listen on the port provided by the first argument to
your program
You will be provided with the location of the file to serve as the second
command-line argument. You must use the fs.createReadStream() method to
stream the file contents to the response
HTTP Uppercaserer
Write an HTTP server that receives only POST requests and converts
incoming POST body characters to upper-case and returns it to the client
Your server should listen on the port provided by the first argument to
your program
HTTP JSON API Server
Write an HTTP server that serves JSON data when it receives a GET request
to the path ‘/api/parsetime’. Expect the request to contain a query string
with a key ‘iso’ and an ISO-format time as the value
For example:
/api/parsetime?iso=2013-08-10T12:10:15.474Z
The JSON response should contain only ‘hour’, ‘minute’ and ‘second’
properties. For example:
Add second endpoint for the path ‘/api/unixtime’ which accepts the same
query string but returns UNIX epoch time in milliseconds (the number of
milliseconds since 1 Jan 1970 00:00:00 UTC) under the property ‘unixtime’.
For example:
Your server should listen on the port provided by the first argument to
your program