Framework40K+/wkMIT

sails

Sails.js is an MVC web application framework for Node.js inspired by Ruby on Rails, designed to make it easy to build custom, enterprise-grade Node.js applicati

Installation

npm
npm install sails
yarn
yarn add sails
pnpm
pnpm add sails

Import

ESM
// Used via CLI: sails generate

Quick Example

usage
// api/controllers/UserController.js
module.exports = {
  find: async function (req, res) {
    const users = await User.find();
    return res.json(users);
  },
};

About sails

Sails.js is an MVC web application framework for Node.js inspired by Ruby on Rails, designed to make it easy to build custom, enterprise-grade Node.js applications. Sails provides a conventional project structure with models, controllers, services, policies (middleware), and configuration files organized in predictable directories. The framework includes Waterline, an ORM/ODM that supports multiple database adapters including PostgreSQL, MySQL, MongoDB, and Redis, allowing developers to switch databases without changing application code. Sails features automatic RESTful API generation — defining a model automatically creates CRUD endpoints accessible through a conventional URL structure. The framework includes real-time communication through integrated Socket.IO support, allowing controllers to handle both HTTP and WebSocket requests transparently. Sails provides a blueprint system that automatically generates routes and actions for models, significantly reducing boilerplate for data-driven applications. The framework is well-suited for building dashboards, chat applications, and multi-player games that need real-time capabilities alongside traditional REST APIs, and for teams familiar with Rails conventions.

Quick Facts

Packagesails
CategoryFramework
Weekly Downloads40K+
LicenseMIT
Installnpm install sails

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.