sails
Version:
API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)
69 lines (40 loc) • 6.9 kB
Markdown
# Available hooks
This page is meant to be an up to date, comprehensive list of all of the core hooks in the Sails.js framework, and a reference of a few of the most popular community-made hooks.
### Core hooks
The following hooks are maintained by the Sails.js core team and are included in your Sails app by default. You can override or disable them using your [sailsrc file](https://sailsjs.com/documentation/concepts/configuration/using-sailsrc-files) or [environment variables](https://sailsjs.com/documentation/concepts/configuration#?setting-sailsconfig-values-directly-using-environment-variables).
| Hook | Package | Latest stable release | Purpose |
|:---------------|---------------|-------------------------|:------------|
| `grunt` | [sails-hook-grunt](https://npmjs.com/package/sails-hook-grunt) | [](http://badge.fury.io/js/sails-hook-grunt) | Governs the built-in asset pipeline in Sails.
| `orm` | [sails-hook-orm](https://npmjs.com/package/sails-hook-orm) | [](http://badge.fury.io/js/sails-hook-orm) | Implements support for Waterline ORM in Sails.
| `sockets` | [sails-hook-sockets](https://npmjs.com/package/sails-hook-sockets) | [](http://badge.fury.io/js/sails-hook-sockets) | Implements Socket.io support in Sails.
### sails-hook-orm
Implements support for the Waterline ORM in Sails.
[](http://npmjs.com/package/sails-hook-orm) [](http://npmjs.com/package/sails-hook-orm)
> + The default configuration set by this hook can be found [here](https://www.npmjs.com/package/sails-hook-orm#implicit-defaults).
> + You can find futher details about this hook's purpose [here](https://www.npmjs.com/package/sails-hook-orm#purpose).
> + You can disable this hook by following [these instructions](https://www.npmjs.com/package/sails-hook-orm#can-i-disable-this-hook).
### sails-hook-sockets
Implements socket.io support in Sails.
[](http://npmjs.com/package/sails-hook-sockets) [](http://npmjs.com/package/sails-hook-sockets)
> + You can find futher details about this hook's purpose [here](https://www.npmjs.com/package/sails-hook-sockets#purpose).
### sails-hook-grunt
Implements support for the built-in asset pipeline and task runner in Sails.
[](http://npmjs.com/package/sails-hook-grunt) [](http://npmjs.com/package/sails-hook-grunt)
> + You can find futher details about this hook's purpose [here](https://www.npmjs.com/package/sails-hook-grunt#purpose).
> + You can disable this hook by following [these instructions](https://www.npmjs.com/package/sails-hook-grunt#can-i-disable-this-hook).
### Community-made hooks
There are more than 200 community hooks for Sails.js [available on NPM](https://www.npmjs.com/search?q=sails+hook). Here are a few highlights:
| Hook | Maintainer | Purpose | Stable release |
|-------------|-------------|:---------------|----------------|
| [sails-hook-webpack](https://www.npmjs.com/package/sails-hook-webpack) | [Michael Diarmid](https://github.com/Salakar) | Use Webpack for your Sails app's asset pipeline instead of Grunt. | [](http://npmjs.com/package/sails-hook-webpack)
| [sails-hook-postcss](https://www.npmjs.com/package/sails-hook-postcss) | [Jeff Jewiss](https://github.com/jeffjewiss)| Process your Sails application’s CSS with Postcss. | [](http://npmjs.com/package/sails-hook-postcss)
| [sails-hook-babel](https://www.npmjs.com/package/sails-hook-babel) | [Onoshko Dan](https://github.com/dangreen), [Markus Padourek](https://github.com/globegitter) & [SANE](http://sanestack.com/) | Process your Sails application’s CSS with Postcss. | [](http://npmjs.com/package/sails-hook-babel)
| [sails-hook-responsetime](https://www.npmjs.com/package/sails-hook-responsetime) | [Luis Lobo Borobia](https://github.com/luislobo)| Add X-Response-Time to both HTTP and Socket request headers. | [](http://npmjs.com/package/sails-hook-responsetime)
| [sails-hook-winston](https://www.npmjs.com/package/sails-hook-winston) | [Kikobeats](https://github.com/Kikobeats) | Integrate the Winston logging system with your Sails application. | [](http://npmjs.com/package/sails-hook-winston)
| [sails-hook-allowed-hosts](https://www.npmjs.com/package/sails-hook-allowed-hosts) | [Akshay Bist](https://github.com/elssar) | Ensure that only requests made from authorized hosts/IP addresses are allowed. | [](http://npmjs.com/package/sails-hook-allowed-hosts)
| [sails-hook-cron](https://www.npmjs.com/package/sails-hook-cron) | [Eugene Obrezkov](https://github.com/ghaiklor) | Run cron tasks for your Sails app. | [](http://npmjs.com/package/sails-hook-cron)
| [sails-hook-organics](https://www.npmjs.com/package/sails-hook-organics) | [Mike McNeil](https://github.com/mikermcneil) | Exposes a set of commonly-used functions ("organics") as built-in helpers in your Sails app. | [](http://npmjs.com/package/sails-hook-organics)
##### Add your hook to this list
If you see out of date information on this page, or if you want to add a hook you made, please submit a pull request to this file updating the table of community hooks above.
Note: to be listed on this page, an adapter must be free and open-source (_libre_ and _gratis_), preferably under the MIT license.
<docmeta name="displayName" value="Available hooks">