Post/Code

HomeAboutUsesNow

Node.js Basics and 200 badges on Treehouse.

  • You can access the command line arguments in node.js using process.argv
  • console.dir, console.error
    https.get(url, (res) => {
        const response = "";
        res.on('data', data => {
            response += data.toString();
        })
        res.on('end', () => {
            const result = JSON.parse(response);
            console.dir(result);
        })
    });
  • 200 badges on Treehouse! Link
  • 200 OK, 500 Internal Server Error, 404 Not Found, 301 Moved permanently