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

trailpack

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trailpack

Trailpack Interface. Trailpacks extend the functionality of the Trails framework.

  • 0.0.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
increased by6182.35%
Maintainers
1
Weekly downloads
 
Created
Source

trailpack

Gitter NPM version Build status Dependency Status Code Climate

Trailpack Interface. Trailpacks extend the functionality of the Trails framework. (Application functionality should be extended using Microservices).

Usage

This module is a class which should be extended by all trailpacks.

const Trailpack = require('trailpack')

class HipsterMagic extends Trailpack {
  constructor (app) {
    super(app, {
      config: require('./config'),
      api: require('./api'),
      pkg: require('./package')
    })
  }

  // ...
}

Lifecycle

  1. app.start
  2. Validate
  3. Configure
  4. Initialize
  5. app.ready

API

constructor(app, module, config, api)

Instantiate the Trailpack. config and api are optional arguments.

validate()

Validate the preconditions for proper functioning of this trailpack. For example, if this trailpack requires that a database is configured in config/database.js, this method should validate this. This method should incur no side-effects. Do not alter any extant configuration.

configure()

Extend the configuration (config/, or app.config) of the application, or add new configuration objects. This method is run before the application has loaded.

initialize()

If you need to bind any event listeners, start servers, connect to databases, all of that should be done in initialize. Here, all of the configuration is loaded and finalized.

Contributing

We love contributions! In order to be able to review your code efficiently, please keep the following in mind:

  1. Pull Requests (PRs) must include new and/or updated tests, and all tests must pass.
  2. Use eslint! See the eslintConfig in package.json.
  3. Please reference the relevant issue in your Pull Request.

License

MIT

Keywords

FAQs

Package last updated on 14 Dec 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