{"name":"sails-hook-actions","version":"1.0.1","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":"72eeddef48bf4548e885b8aa97505670a9031533","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.1","_shasum":"76b2cb6dcadae9094584b57e17618cd62ab8852d","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"76b2cb6dcadae9094584b57e17618cd62ab8852d","tarball":"http://registry-npm.ywwl.com/sails-hook-actions/download/sails-hook-actions-1.0.1.tgz","integrity":"sha512-fkv013yl4p2KBmYCZkTwHbqr/tSRD3kMVhVdTHAfQl2mVWeIN1E/43qkeU+Pre6zOO5TPJYON62ljkNBOnpdvw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/Qk/j70vc6VLyL9Wj/fy3VLiObc8N/Suu78m9769RNAiAfgguDIKV53bHQfH/HTWUyq4J1+e4MSv7Rjal+kYhVCQ=="}],"size":10865,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.0.1.tgz"},"maintainers":[{"name":"sgress454","email":"sgress454@treeline.io"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.0.1.tgz_1473183384164_0.6787884079385549"},"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":1473183385128,"_cnpm_publish_time":1473183385128,"dist-tags":{"latest":"1.1.1"}}