1.0.0 • Published 8 years ago

trailpack-machinepack v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

trailpack-machinepack

Gitter NPM version NPM downloads Build status Dependency Status Code Climate

:package: Map node machine packs into Trails services

Intallation

With yo :

npm install -g yo generator-trails
yo trails:trailpack trailpack-machinepack

With npm (you will have to create config file manually) :

npm install --save trailpack-machinepack

Configuration

// config/machinepack.js
module.exports = {
  machines: {
      email: require('machinepack-email'),
      json: require('machinepack-json'),
      gravatar: require('machinepack-gravatar')
       // ...
    }
  /*or if you are sure there no conflict between machines
  machines: [
      require('machinepack-email'),
      require('machinepack-json'),
      require('machinepack-gravatar')
      // ...
    ]
  */
}

Usage

Now you can use your machine pack under controllers, policies services and models like this :

this.app.services.MachineService.json.stringify(...)

or if you use an array on config/machinepack
 
this.app.services.MachineService.stringify(...)

License

MIT