{"name":"sails-hook-actions","version":"1.1.1","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":"^7.0.0","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":"839fbcac9f7f90bbcd3d024629a8bdaa0d263106","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.1","_shasum":"2ef318412168cc14e4bbd26273d1b9fe41e14f80","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"2ef318412168cc14e4bbd26273d1b9fe41e14f80","tarball":"http://registry-npm.ywwl.com/sails-hook-actions/download/sails-hook-actions-1.1.1.tgz","integrity":"sha512-FQgGM8+ZPA9KI+gbp2ADoyhm1bjM1/U7qQ3vUOimN6FlF8XX7101MTnGiCpwZdMCSg3+661+sSnO9/Rpr08B2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTO2iLMZeW9dIvx92XDWREmyROcrdO7lKUoBnBWpWxawIhAJmfoXoAxnBviiZyE3MAwq0HdkN9R+rGm+zTyeNqRBb1"}],"size":125027,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.1.1.tgz"},"maintainers":[{"name":"sgress454","email":"sgress454@treeline.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.1.1.tgz_1473307901110_0.21156650898046792"},"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":1473307903152,"_cnpm_publish_time":1473307903152,"dist-tags":{"latest":"1.1.1"}}