Javascript is already widely used inside browsers. The arrival of Node.js by Ryan Dahl combined with Google’s V8 Javascript engine pushed Node.js to be one of the most popular languages for writing non-blocking code to power HTTP APIs. Native JSON support along with light frameworks like express.js enabled Node.js to be a breeze for standing up quick APIs without the fuss of heavier frameworks.

In fact, our analytics data shows Node.js as being the most popular language for creating REST and GraphQL APIs. The explosive growth in React and Single Page Apps has added fuel to the growth of Node.js for creating APIs. It’s event driven model make it a perfect candidate for building serverless apps on platforms like AWS lambda.

Background on Node.js and Key Concepts

Sometime is worth understanding the motivation and history of Node.JS. And the key motivation (compared to previously techniques), especially regarding Non Blocking IO and asynchronous techniques.

Tutorials for Creating RESTFul APIs

Like most web pages, you usually build APIs on tops of an existing framework (especially for routing). So the tutorials below are organized by framework.

Tutorials for Creating GraphQL APIs

GraphQL is promoted as an alternative to RESTful API, you can read more about the background on GraphQL, and other types of APIs here.

Tutorials for Deployment

Useful Libraries

The most popular package manager for node is NPM.

  • Documentation

  • Authentication

  • CORS

  • Proxy

  • JSON

    • body-parser - a standard JSON parsing middleware that comes with expressjs
    • jsonfile - reading and writing JSON files.
  • Utilities

  • Databases, Query Builder and ORMs

  • Drivers
  • ODM / ORM
    • Sequelize - Multi-dialect ORM. Supports PostgreSQL, SQLite, MySQL.
    • Bookshelf - ORM for PostgreSQL, MySQL and SQLite3 in the style of Backbone.js.
    • Massive - PostgreSQL data access tool.
    • Mongoose - Elegant MongoDB object modeling.
    • Waterline - Datastore-agnostic tool that dramatically simplifies interaction with one or more databases.
    • Iridium - MongoDB ORM with support for promises, distributed caching, preprocessing, validation and plugins.
    • OpenRecord - ORM for PostgreSQL, MySQL, SQLite3 and RESTful datastores. Similar to ActiveRecord.
    • orm2 - ORM for PostgreSQL, MariaDB, MySQL, Amazon Redshift, SQLite, MongoDB.
    • firenze - Adapter-based ORM for MySQL, Memory, Redis, localStorage and more.
    • pg-promise - PostgreSQL framework for native SQL using promises.
    • Objection.js - Lightweight ORM built on the SQL query builder Knex.
  • Query builder
    • Knex - Query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.
  • Other
    • NeDB - Embedded persistent database written in JavaScript.
    • Lowdb - Small JavaScript database powered by Lodash.
    • Keyv - Simple key-value storage with support for multiple backends.
  • REST

    • Frisby - a test framework for REST APIs.
    • Facet - extensible, framework agnostic JSON API platform for Node.js
    • Restful - a REST client library.
    • hello.js - a REST client library that support OAuth2.
    • Interfake - Rapid prototyping framework for making mock HTTP APIs, with a Node.js, command-line and HTTP interface.
    • ThinkJS - Framework with ES2015+ support, WebSockets, REST API.
    • ActionHero - Framework for making reusable & scalable APIs for TCP sockets, WebSockets, and HTTP clients.
    • LoopBack - Powerful framework for creating REST APIs and easily connecting to backend data sources.
    • restify-mongoose - Generate RESTful API based on your mongoose schema.
  • GraphQL

  • WebSockets

    • Socket.IO - Featuring the fastest and most reliable real-time engine.
    • Nodejs-websocket - Node.js module for websocket server and client.
    • WebSocket-Node - WebSocket Implementation for Node.JS (Draft -08 through the final RFC 6455).
    • Sockjs-node - WebSocket emulation - Node.js server.
    • Ws - ws: The fastest cross platform RFC-6455 WebSocket implementation for Node.js.
    • deepstream.io - Open realtime server a fast, secure and scalable realtime server for mobile, web & iot.
    • websocket-as-promised - Promise-based W3C WebSocket wrapper: allows to use promises when connecting, disconnecting and messaging with WebSocket server.
    • faye-websocket-node - Standards-compliant WebSocket client and server.
    • ws-wrapper - Lightweight WebSocket wrapper that provides a socket.io-like event-handler API along with Promise-based requests.
    • ws-server-wrapper - Companion library for ws-wrapper for the server-side.
    • uws - Tiny WebSockets (access to the C++ library, µWebSockets, via Node.js)

Updated:

Leave a Comment