{"name":"sync-rpc","version":"1.3.6","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":"75a57addbf39a4be2decbef0ac04dee2305bd8db","bugs":{"url":"https://github.com/ForbesLindesay/sync-rpc/issues"},"homepage":"https://github.com/ForbesLindesay/sync-rpc#readme","_id":"sync-rpc@1.3.6","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==","shasum":"b2e8b2550a12ccbc71df8644810529deb68665a7","tarball":"http://registry-npm.ywwl.com/sync-rpc/download/sync-rpc-1.3.6.tgz","fileCount":12,"unpackedSize":14559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOGv7CRA9TVsSAnZWagAA8FYP/146+aYm7wFqtl6BNFoE\nQ4E9vNHoPc9c9nDhgkKJ67LBbjp3jy5lbjgQQqe57A/qCueWFiHM4vPXnkrX\nikzbUD7/wYHsIRPc2sgFQdRlpds2R7A2A49oiRgWkMjTw9rUJBi5BffuY6QW\n/ynuXUTribP9PWOXiLoJ5kryE+RVQHzXO0GZSxRpIgdf8G8GB+i1zrdZJaxf\n4YudC1DmnLxjsXLgqlrc7kL7uAqhHOY/IEDEkZ1qGD2Js3EbnBBSr3X4f4Xq\nwBiTwSUMF9xGl2CajZjK2X2y2UdbCp+Z7P9FZMDxm2lt2pHiOvaofOARRIOk\nor+an47P0qnZzqwDRSVB7wBEid+4kMq4GeqJGnznNSErj63ynzAojAAB/mit\nsx4cyqGxsb/qWZ2Mlp2e3zdwXzdJkNQP3ICpdGGCBAAA+Sy5AiUvSZp67uds\nqw+C+GzWD3r9gIdu4T7Ffn1QH6lVrqvAbpnCUR5fPZG17920Zmd/Am67yV8M\nSoMMohBTX+G3rt7x1ZNTflxHVkqwq+YEXD79g/2jHSO3ZbaGERG886Zx2xdx\nHcYyh7opcNGSY26BrtUOYsk6/q0eal87uRWAfGR/PsFbX3Aj76R4OiAM4vTY\nJK+tKiBw+9GMLDdSPRLCpI6aehA3drOhXl6bZsZ3uuMTtM42aQnwEqWeuK1q\njpcv\r\n=makR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2ifTr+9SQ7ZzwWXkVUPDbliFp6XO0PrC5A1exDvbvGAiEA483HMEuEK3FozftslXBkAKCd/aw8pI1+M4RXpWG1ros="}],"size":5172,"noattachment":false,"key":"/sync-rpc/-/sync-rpc-1.3.6.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.6_1563978746590_0.0014291827458621231"},"_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":1563978746785,"_cnpm_publish_time":1563978746785,"dist-tags":{"latest":"1.3.7"}}