25 Node.js Nuggets
My last Nuggets post, “50 Linux Resources for Developers” was pretty well-received, so I figured I’d try to do the same thing I did there for Node.js. Hopefully something here gives you some inspiration to make the next great Javascript app. It’s not meant to be an all-inclusive guide to learning Node, but more of a look at my journey with Node and some things I’ve found useful which you might find useful as well.
For a little background, here’s the synopsis of Node.js from their website:
Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
If you haven’t played with Node.js before, I highly recommend it. So, without any further ado, here’s my list of Node.js nuggets.
Node.js Tutorials & Documentation
Node.js and Express – Creating a REST API – This is a brief introduction into creating a RESTful API with Node.js and Express.
Node.js and Express – Sessions – A primer on tracking users on your webapp using Express sessions management.
Chat Evolution – Node.js and Socket.io – A blog post with code describing how to write a real-time chat system using Node.js and socket.io.
Deploying Node.js with Upstart and Monit – Learn how to daemonize Node.js apps with Upstart and Monit so you can run them as stable services.
Other Learning Resources
How to get started with Node.js – A StackOverflow question with great answers, including links to all kinds of documentation, tutorials, and frameworks. Definitely bookmark-worthy.
How To Node – A community-driven blog about Node.js covering all kinds of topics, such as using Grunt (what’s Grunt?), getting started with MongoDB (what’s MongoDB?), and more.
Node.js Cheat Sheet – This has links to official and unofficial documentation, recommended libraries, and snippets showing some use cases of libraries like Express and should.js.
Web App Utilities
Express.js – If you haven’t used Express to build a webapp with Node.js before, you should definitely check it out, along with several of the Express middleware collections in this post.
Passport – Passport is an authentication middleware for Node.js and Express that lets you manage logins, enable logins with Twitter or Facebook, and much more. Get started with their overview.
socket.io – Socket.io library for Node.js that works on its own or with Express, allowing real-time interaction with users.
Security
validator.js – Great library for validating and sanitizing user input in Javascript that can be used server-side or client-side.
helmet – Implement various security policies, like hiding the X-Powered-By header, and X-XSS protection in Express with this middleware.
Content
twit – A great Twitter API for getting streams of tweets in real time, searching tweets, getting a user’s timeline, and more
node-feedparser – Node-feedparser is a module that makes processing RSS, Atom, and RDF feeds a breeze
unfluff – Parse HTML for its textual content. Useful for scraping news sites, blog posts, etc. for their raw content.
natural – Natural is a natural language processing (NLP) library for Node.js that has features like word tokenization, Naive Bayes and logistic regression classification, and phonetics analysis.
sentiment – Perform sentiment analysis on strings in Node.js using the AFINN-111 dictionary.
General Utility Libraries
watch – Watch is a set of utilities to monitor file tree changes, which can be very useful for tracking log files, temporary files, etc.
request – An easy-to-use HTTP requests library with features like OAuth signing, HTTP auth, and more features you’d expect.
async.js – All kinds of utilities for working with asynchronous code in this library. For instance, you can run several functions in series or in parallel, filter and map arrays through functions, and more.
should.js – A Behavior-driven development (BDD) assertions library for Node.js that lets you do all kinds of data validation, such as checking that an object contains a particular property, that a user input string ends with a certain string, and much more. The syntax makes it very easy to write tests for your code.
minimist – A lightweight Node.js framework for easily handling option parsing on the command line.
jsdom – A Node.js implementation of the WHATWG DOM & HTML standards that lets you manipulate JavaScript on the server side as if you were in a browser.
Standalone Utilities
Bower – Bower is billed as a “package manager for the web,” letting you install JS libraries like jQuery, Github repositories, and more, in a structured way.
Grunt – Grunt is a task-runner that can help you compile your CSS, lint and minify your JS, and much more.
And there it is! If you have any other good resources, include them in the comments or ping me on Twitter!