{"name":"sails-hook-actions","version":"1.0.0","description":"Allow Sails to load machines from an `api/actions` folder and load them using machine-as-action","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Scott Gress"},"license":"MIT","dependencies":{"lodash":"^3.10.1","machine-as-action":"^6.0.1","sails-build-dictionary":"^0.10.1","sails-util":"^0.11.0"},"sails":{"isHook":true,"hookName":"controllers"},"repository":{"type":"git","url":"git://github.com/treelinehq/sails-hook-actions.git"},"gitHead":"7a6e1ffc4d237768616fe70f306ae3cfc1938269","bugs":{"url":"https://github.com/treelinehq/sails-hook-actions/issues"},"homepage":"https://github.com/treelinehq/sails-hook-actions#readme","_id":"sails-hook-actions@1.0.0","_shasum":"404c2f425feaf9a9ba17222c97c0fea113ddd53f","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"404c2f425feaf9a9ba17222c97c0fea113ddd53f","tarball":"http://registry-npm.ywwl.com/sails-hook-actions/download/sails-hook-actions-1.0.0.tgz","integrity":"sha512-kGnsbvtuqCJvDmHZox6UwQTuD1S41cHlE9yFVqRU4+fcGoJi+rGo4WWqYvzjtnvzT9ekNvUh+bE9Xg6EJkXPYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9EAxiGbdidQkElxdOD3FT4ndMdGy8Bi+adR77KaoldwIhAJPn3yg3fFFOhtwyhVI8eQ0G4gTfbg8ILryRVxwMidvL"}],"size":6863,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.0.0.tgz"},"maintainers":[{"name":"sgress454","email":"sgress454@treeline.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.0.0.tgz_1471229308855_0.19169108476489782"},"directories":{},"readme":"# sails-hook-actions\n\n[Sails JS](http://sailsjs.org) hook to load files from the `api/actions` folder and interpret them as machines compatible with [machine-as-action](https://github.com/treelinehq/machine-as-action).\n\nThis hook adds support for the `{action: 'some-action'}` route target syntax.  Traditional controller files (in `api/controllers`) and controller route target syntax are still supported.\n\n### Installation\n\n`npm install sails-hook-actions`\n\n### Usage\n*requires at least sails >= 0.12*\n\nCreate an `api/actions` folder, then add Javascript files (ending in `.js`) in that folder or in subfolders.  The files must be valid [node-machine](http://node-machine.org/) definitions, and may include the additional options described in the [machine actions](https://github.com/treelinehq/machine-as-action) docs (e.g. the `responseType` property for exits).\n\nTo point a route at an action, use the `{action: 'some-action-identity'}` syntax, for example:\n\n```\n'GET /hi': {action: 'say-hi'}\n'POST /user/go': {action: 'useractions/some-user-action'}\n```\n\nwhere the value of `action` is the identity of an action (i.e. its filepath relative to `api/actions`, lowercased and without the `.js` extension)\n","publish_time":1471229310666,"_cnpm_publish_time":1471229310666,"dist-tags":{"latest":"1.1.1"}}