1.0.0 • Published 8 years ago
marlinspike v1.0.0
marlinspike
Superpowers for your Sails.js Hooks.
This package was last updated in 2015. For the most up-to-date information and tools related to hooks in Sails, visit the official Sails website or ask for help.
Features
- Makes it easy to build and maintain Sails Hooks as separate projects
- Magically extend Sails apps with additional Model, Controllers, Services.
Compatibility
- Sails.js 0.12 and newer
- node.js 0.12 and newer
Install
$ npm install marlinspike --save
Usage
// config/customhook.js
export const customhook = {
/**
* Load hook into sails.hooks.custom
*/
name: 'custom',
/**
* Load hook config into sails.hook.customHook
*/
configKey: 'customHook',
marlinspike: {
/**
* Load controllers from ../api/controllers into the parent app
*/
controllers: true,
/**
* Load models from ../api/models into the parent app
*/
models: true,
/**
* Load services from ../api/services into the parent app
*/
services: true,
/**
* Load config from ../config/customhook.js into the parent app
*/
config: true
}
}
// api/hooks/customhook.js
import Marlinspike from 'marlinspike'
class CustomHook extends Marlinspike {
defaults (overrides) {
// http://sailsjs.org/documentation/concepts/extending-sails/hooks/hook-specification/defaults#?using-defaults-as-a-function
},
configure () {
// this.sails = sails
// http://sailsjs.org/documentation/concepts/extending-sails/hooks/hook-specification/configure
},
initialize (next) {
// http://sailsjs.org/documentation/concepts/extending-sails/hooks/hook-specification/initialize
},
routes () {
return {
// http://sailsjs.org/documentation/concepts/extending-sails/hooks/hook-specification/routes
}
}
}
export default Marlinspike.createSailsHook(CustomHook)
License
MIT
50.0.0
8 years ago
1.0.0
10 years ago
0.12.15
10 years ago
0.12.14
10 years ago
0.12.13
10 years ago
0.12.12
10 years ago
0.12.11
10 years ago
0.12.10
10 years ago
0.12.9
10 years ago
0.12.8
10 years ago
0.12.7
10 years ago
0.12.6
10 years ago
0.12.5
10 years ago
0.12.4
10 years ago
0.12.2
10 years ago
0.12.1
10 years ago
0.0.0
10 years ago