{"name":"mschema-rpc","version":"0.7.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":"e36f6f7c0ed191baf817d8a7e85faca88767e43e","bugs":{"url":"https://github.com/mschema/mschema-rpc/issues"},"homepage":"https://github.com/mschema/mschema-rpc#readme","_id":"mschema-rpc@0.7.0","_shasum":"1ad61a6dfddaee460f9eb0a6a160d10b5f74fddf","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.0","_npmUser":{"name":"marak","email":"marak.squires@gmail.com"},"dist":{"shasum":"1ad61a6dfddaee460f9eb0a6a160d10b5f74fddf","tarball":"http://registry-npm.ywwl.com/mschema-rpc/download/mschema-rpc-0.7.0.tgz","integrity":"sha512-axuRgIRfg/CGeRuPeZLZUp6sgTn39I/niecklvPgqbxUxBgyeDRrPyAnMR2NINSasaENaNESF5Ff87XtHyYhHw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDFuPGDTIpMjLA/SHRV/U/XSUpYAdtU2fzVnTXcAmWiyAiEAy+qV+LYOUKe37o/WgxWONhsvNFn7+S1ghL6H8UC6kV0="}],"size":6209,"noattachment":false,"key":"/mschema-rpc/-/mschema-rpc-0.7.0.tgz"},"maintainers":[{"name":"marak","email":"marak.squires@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/mschema-rpc-0.7.0.tgz_1481747385452_0.5664986637420952"},"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":1481747386060,"_cnpm_publish_time":1481747386060,"dist-tags":{"latest":"0.7.0"}}