{"name":"sync-rpc","version":"1.3.4","main":"lib/index.js","description":"Run asynchronous commands synchronously by putting them in a separate process","keywords":[],"files":["lib/"],"dependencies":{"get-port":"^3.1.0"},"devDependencies":{"husky":"*","jest":"*","lint-staged":"*","prettier":"*"},"scripts":{"precommit":"lint-staged","prettier":"prettier --write \"lib/**/*.js\"","prettier:check":"prettier --list-different \"lib/**/*.js\"","test":"jest --coverage","watch":"jest --coverage --watch"},"lint-staged":{"*.js":["prettier --write","git add"]},"repository":{"type":"git","url":"git+https://github.com/ForbesLindesay/sync-rpc.git"},"author":{"name":"Forbes Lindesay","url":"http://github.com/ForbesLindesay"},"license":"MIT","gitHead":"e0b4841970ef86ebc78a66438e3b311ab9638302","bugs":{"url":"https://github.com/ForbesLindesay/sync-rpc/issues"},"homepage":"https://github.com/ForbesLindesay/sync-rpc#readme","_id":"sync-rpc@1.3.4","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"dist":{"integrity":"sha512-Iug+t1ICVFenUcTnDu8WXFnT+k8IVoLKGh8VA3eXUtl2Rt9SjKX3YEv33OenABqpTPL9QEaHv1+CNn2LK8vMow==","shasum":"24bcbdb2ffcb98f23690c15b304660085cdd206c","tarball":"http://registry-npm.ywwl.com/sync-rpc/download/sync-rpc-1.3.4.tgz","fileCount":12,"unpackedSize":13469,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+VHXCRA9TVsSAnZWagAA35EP/j1keDYqe2ejE7gYOLAL\nUtPeANAaTFXDIn+pyldwonI3COCwwR4OeTSc8dLgJzkpSx03ysor9OrRtzYY\neUAuMLPbtYTKqoe40fViN5H0yyObPktswvjNcztaSQ1A2rs+wBgq+HiLW++a\nIUK9eI2xgTouOtCkmW+bbxp5sxBkuBob/yIJ2kRu8yEwG9rOiIhynd0DRas9\nseWgCvJKMfaLLwYNeS2vk5uRBuLKd06ZeQNAy+O+7uFtpviV3dqLUKPEpfbM\nJeS6Q42+u5DyNoqPxpGNgFB1h78yR5/L0VMkxkgHJG7xC64oCWwHFYIYKZRB\n8C/6LV+1m3BeM0EnIFXpX+zE6RYlgiUeXTGxZMH4N/Nap9pobOfmhdn5F1Mp\nnKkLbjNbVmtG1/YgwgY8+JGJPW/XRl+MNKsQF+xLZ1YrOjp3nCcGQmiSIRbR\njZu1WUfHan/yLsBYQcetsm75IC8kKral2Days9icQafJ/P9gX+5cO82FcNZx\ncLPgAhRuO2JRVE3Z6p7Sbio1A3m6NLvbCSfNGUALMUlzpG/kiEOwKhBzpP1g\nkSj8s4Qa3pQvsWUDDmeIaE3/Xnnw9Zmlr/3mo90/04OsTOd+hQJoGnu4zg+j\nu9d8Cf7sMbo/qnlbZNmN7sP1wd+ce5Ebq8LrV69s2a9zOMb2xGxm1gHcal3c\nTN/p\r\n=oxnS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAidACIF46nMvF06OjMSMoY1aCK+R+IFCeggOV8n4c5AIgLUi+KIg5d92I0G/Z5BFK3xWc3C7OTBzTSqWBWYMo0BA="}],"size":4957,"noattachment":false,"key":"/sync-rpc/-/sync-rpc-1.3.4.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-rpc_1.3.4_1526288854361_0.45787652304986315"},"_hasShrinkwrap":false,"readme":"# sync-rpc\n\nRun asynchronous commands synchronously by putting them in a separate process\n\n[![Build Status](https://img.shields.io/travis/ForbesLindesay/sync-rpc/master.svg)](https://travis-ci.org/ForbesLindesay/sync-rpc)\n[![Dependency Status](https://img.shields.io/david/ForbesLindesay/sync-rpc/master.svg)](http://david-dm.org/ForbesLindesay/sync-rpc)\n[![NPM version](https://img.shields.io/npm/v/sync-rpc.svg)](https://www.npmjs.org/package/sync-rpc)\n\n## Installation\n\n```\nnpm install sync-rpc --save\n```\n\n## Usage\n\n### worker.js\n\n```js\nfunction init(connection) {\n  // you can setup any connections you need here\n  return function (message) {\n    // Note how even though we return a promise, the resulting rpc client will be synchronous\n    return Promise.resolve('sent ' + message + ' to ' + connection);\n  }\n}\nmodule.exports = init;\n```\n\n```js\nconst assert = require('assert');\nconst rpc = require('sync-rpc');\n\nconst client = rpc(__dirname + '/../test-worker.js', 'My Server');\n\nconst result = client('My Message');\n\nassert(result === 'sent My Message to My Server');\n```\n\n## License\n\nMIT\n","publish_time":1526288854452,"_cnpm_publish_time":1526288854452,"dist-tags":{"latest":"1.3.7"}}