{"name":"mschema-rpc","version":"0.6.0","description":"Minimalistic Remote Procedural Call library using mschema validation for remote method's input and output.","keywords":["rpc","remote","method","schema","mschema","validator"],"main":"index.js","directories":{"example":"examples","test":"tap test/"},"scripts":{"test":"tap test"},"repository":{"type":"git","url":"git+ssh://git@github.com/mschema/mschema-rpc.git"},"dependencies":{"mschema":"0.5.x"},"devDependencies":{"tap":"~0.4.4"},"author":{"name":"Marak Squires","email":"support@marak.com"},"license":"MIT","gitHead":"0834dc1fab80f3a87944b43f942ed340c488db2e","bugs":{"url":"https://github.com/mschema/mschema-rpc/issues"},"homepage":"https://github.com/mschema/mschema-rpc#readme","_id":"mschema-rpc@0.6.0","_shasum":"30b58e88f6da6105d19dfc5347f5a234e809aa59","_from":".","_npmVersion":"3.3.3","_nodeVersion":"0.12.7","_npmUser":{"name":"marak","email":"marak.squires@gmail.com"},"maintainers":[{"name":"marak","email":"marak.squires@gmail.com"}],"dist":{"shasum":"30b58e88f6da6105d19dfc5347f5a234e809aa59","tarball":"http://registry-npm.ywwl.com/mschema-rpc/download/mschema-rpc-0.6.0.tgz","integrity":"sha512-C0wY6B/EYw2Ou6aWezZwvZ9+GfNhJpV+fAacbXFeYe2ArMnwovu9y1h4gm3EoWlvpBJQy+wj5HZbqyIMXOjD6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHKoaxoTbXShYC/OFxsQw/yX2lK8OtC+f7dBDSCrQVWAiBOuX+HL/xQIKlhB/EjdosAqJtHJEb6F/9EWmyuX1gHag=="}],"size":6166,"noattachment":false,"key":"/mschema-rpc/-/mschema-rpc-0.6.0.tgz"},"readme":"# mschema-rpc\n\n<img src=\"https://travis-ci.org/mschema/mschema-rpc.svg?branch=master\"/>\n\nMinimalistic [Remote Procedural Call](http://en.wikipedia.org/wiki/Remote_procedure_call) library using [mschema](http://mschema.org) validation for remote method's input and output.\n\n## Features\n\n - Provides validation to functions incoming arguments and outgoing results\n - Validation based on [mschema](http://mschema.org)\n\n# API\n\n### rpc.invoke(inputData, method, methodSchema, callback)\n\n### inputData\nthe input data to be sent to `method`\n\n### method\nthe method to be executed remotely\n\n### methodSchema\nthe schema to be used to validate the input and output of `method`\n\n**schema format**\n```json\n{\n  \"input\": {\n    \"key\": \"val\"\n  },\n  \"output\": {\n    \"key\": \"val\"\n  }\n}\n```\n*see: http://github.com/mschema/mschema for full schema format documentation*\n\n### callback\n\nthe callback to be executed after `method` has been invoked\n\n## Example\n\n```js \n\nvar rpc = require('mschema-rpc');\n\nvar fireSchema = {\n  \"description\": \"fires missle\",\n  \"input\": {\n    \"name\": \"string\",\n      \"power\": {\n        \"type\": \"string\",\n        \"enum\": [\"high\", \"medium\", \"low\"]\n      },\n      \"warheads\": {\n        \"type\": \"number\",\n        \"min\": 1,\n        \"max\": 8\n      }\n    },\n  \"output\": {\n    \"result\": \"string\"\n  }\n};\n\nfunction fireFn (input, callback) {\n  callback(null, 'weapon fired');\n}\n\nvar data = {\n  \"name\": \"small missle\",\n  \"power\": \"low\",\n  \"warheads\": 8\n};\n\nrpc.invoke(data, fireFn, fireSchema, function(errors, result) {\n  console.log('errors', errors);\n  console.log('result', result);\n});\n```","publish_time":1449202979303,"_cnpm_publish_time":1449202979303,"dist-tags":{"latest":"0.7.0"}}