Back to Sails

Available hooks

docs/concepts/extending-sails/Hooks/available-hooks.md

12.12.20006.7 KB
Original Source

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 or environment variables.

HookPackageLatest stable releasePurpose
gruntsails-hook-gruntGoverns the built-in asset pipeline in Sails.
ormsails-hook-ormImplements support for Waterline ORM in Sails.
socketssails-hook-socketsImplements Socket.io support in Sails.

sails-hook-orm

Implements support for the Waterline ORM in Sails.

 

  • The default configuration set by this hook can be found here.
  • You can find futher details about this hook's purpose here.
  • You can disable this hook by following these instructions.

sails-hook-sockets

Implements socket.io support in Sails.

 

  • You can find futher details about this hook's purpose here.

sails-hook-grunt

Implements support for the built-in asset pipeline and task runner in Sails.

 

  • You can find futher details about this hook's purpose here.
  • You can disable this hook by following these instructions.

Community-made hooks

There are more than 200 community hooks for Sails.js available on NPM. Here are a few highlights:

HookMaintainerPurposeStable release
sails-hook-webpackMichael DiarmidUse Webpack for your Sails app's asset pipeline instead of Grunt.
sails-hook-postcssJeff JewissProcess your Sails application’s CSS with Postcss.
sails-hook-babelOnoshko Dan, Markus Padourek & SANEProcess your Sails application’s CSS with Postcss.
sails-hook-responsetimeLuis Lobo BorobiaAdd X-Response-Time to both HTTP and Socket request headers.
sails-hook-winstonKikobeatsIntegrate the Winston logging system with your Sails application.
sails-hook-allowed-hostsAkshay BistEnsure that only requests made from authorized hosts/IP addresses are allowed.
sails-hook-cronEugene ObrezkovRun cron tasks for your Sails app.
sails-hook-organicsMike McNeilExposes a set of commonly-used functions ("organics") as built-in helpers in your Sails app.
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">