Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

marlinspike

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marlinspike

Superpowers for your Sails.js Hooks

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
106
decreased by-26.39%
Maintainers
3
Weekly downloads
 
Created
Source

marlinspike

NPM version Build status Dependency Status Code Climate

Superpowers for your Sails.js Hooks.

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

Maintained By

Keywords

FAQs

Package last updated on 16 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc