{"name":"sync-rpc","version":"1.3.5","main":"lib/index.js","description":"Run asynchronous commands synchronously by putting them in a separate process","keywords":[],"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":"c37361961b03c69fdb1c82c5bbb193a1ea900f34","bugs":{"url":"https://github.com/ForbesLindesay/sync-rpc/issues"},"homepage":"https://github.com/ForbesLindesay/sync-rpc#readme","_id":"sync-rpc@1.3.5","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-e73GDwlxlOeQCnmM6rej2eJ9ea1hkgzP1DOkm7ZO8F4NetNOa2wVfJTd1KX7ZbOpvy8wcl7uksfygQ/g7zGyAg==","shasum":"1784b38377b18497e5e0fba5b5c1a6b9a32225d3","tarball":"http://registry-npm.ywwl.com/sync-rpc/download/sync-rpc-1.3.5.tgz","fileCount":12,"unpackedSize":13592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOGtmCRA9TVsSAnZWagAAchgP/RlXlD6G9WAOUFtYIV1Q\nekXY6xaVsp485kGaEeEe6luZo3RugfmeXNflxIFuzYfE4dKgnecKksCanzyQ\nOr6Qg3m5k29UySWfG0Rvwe0yEuV76i192wwK81A8bWaRKb9wKyMN9MRbobwC\n9hr7CMyIcA/z0XJPtxYJtzFCCdnhGvvPTVdX1PkHA3EC+FubF4uil1KzoKDr\nxgBtouaQEYdzaAfSmt84TwNFkyqhvGGbO758fXc870IGsZQz3qNEYhqiMgMf\nxTpF3NKk2qXmoAL7iCWAYPn11/v38Pd7pAU5uGPvDzSrjNuL/6wiVvcRX5L0\nbb8G5O6sDhvKnpySh/2xxs+Zc/vChReD7dvMtpQ2YVjGjEKb0tFgppegZC6s\nc+rwN/gD+Px/paZoAEfeLk9OEuCAd1ZvVHM0DdkePvLQqOSqK81qS0ZFiia9\ncD34+crM4+pLacPqqxTOJS2A/VdolHjqRmARRmecQlBdOItFyOj5AJQowyRy\n73usmFuKA+1TVTaHadJJ6mRGYlxWgs6+rEDS7XKWi3baa7df8zo0zh17idzG\nJLzxdK+n9WrqS+xEY6OvhWEckHcqPKY4X+yCmbKccuBhtscq/X4pk3dTM8gO\nTSv6pCMR1VuZyUeXPqIsrVaHch/m0tQKls/EJpEF8DKBL8ytIsSsB9B4AoEr\nhL4Q\r\n=1NN+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClS1f+tSpsBL4BDwt32mdbIb83CwQ3HySAJxgLMN4dbwIhALPle/n+myA4yARyCRfNruCrfwGbZv4z4kLkiJ9YUpjm"}],"size":4985,"noattachment":false,"key":"/sync-rpc/-/sync-rpc-1.3.5.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-rpc_1.3.5_1563978597968_0.9319843677053044"},"_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":1563978598100,"_cnpm_publish_time":1563978598100,"dist-tags":{"latest":"1.3.7"}}