{"name":"sails-hook-actions","version":"1.1.0","description":"Allow Sails to load machines from an `api/actions` folder and load them using machine-as-action","main":"index.js","scripts":{"test":"mocha tests/** -t 10000 -R spec"},"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"},"devDependencies":{"mocha":"^3.0.2","sails":"github:balderdashy/sails#1.0"},"sails":{"isHook":true},"repository":{"type":"git","url":"git://github.com/treelinehq/sails-hook-actions.git"},"gitHead":"63d5c7e0ce11e3ec7c1a757cdb32c031cb0c9e90","bugs":{"url":"https://github.com/treelinehq/sails-hook-actions/issues"},"homepage":"https://github.com/treelinehq/sails-hook-actions#readme","_id":"sails-hook-actions@1.1.0","_shasum":"f69966625c7da21281d53477df3b8a1721f92a9f","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"f69966625c7da21281d53477df3b8a1721f92a9f","tarball":"http://registry-npm.ywwl.com/sails-hook-actions/download/sails-hook-actions-1.1.0.tgz","integrity":"sha512-cD5J4Sv7GOvGFBV3kkLD6fENi/4fh7WOlQCkZa/IrtlFSRsGLJqAO5upXAsQCf3LYCOC8fl+wGsmFzTCi6/avg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLuUOtP+6/Kce3GDLF17xBT0Tc5dAXUgwcIXkFb2nbVAIgY99WqR4Agt6tFfBRk6uFZUlkElsV8cZBhsVkA+AkgG4="}],"size":124833,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.1.0.tgz"},"maintainers":[{"name":"sgress454","email":"sgress454@treeline.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.1.0.tgz_1473187157286_0.4189076067414135"},"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":1473187159125,"_cnpm_publish_time":1473187159125,"dist-tags":{"latest":"1.1.1"}}