{"name":"sync-rpc","version":"1.3.2","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":"d3f7c702313c220f2bb7740a34eb1ae89f48a0d6","bugs":{"url":"https://github.com/ForbesLindesay/sync-rpc/issues"},"homepage":"https://github.com/ForbesLindesay/sync-rpc#readme","_id":"sync-rpc@1.3.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"dist":{"integrity":"sha512-XLPTwFJpN7do26F/iXEhKCJ1GS4bNAZk7lp7Z0yopCqXKIj/1oUZtOX7ycAd8uzmfBndeSVTmglIaVO+j4XQoQ==","shasum":"23ed60e25848cf51d70b55099661d25c135b2db7","tarball":"http://registry-npm.ywwl.com/sync-rpc/download/sync-rpc-1.3.2.tgz","fileCount":12,"unpackedSize":12763,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICuF8njPXXltUQrNj4JXft9OsqFFGx5C8R2FRHpkCy/CAiBEFvpEvS/iOpBHhQUGohCUZYAEWJ6p/wfZDCRhO62kwg=="}],"size":4849,"noattachment":false,"key":"/sync-rpc/-/sync-rpc-1.3.2.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-rpc_1.3.2_1519995993897_0.7334868538270607"},"_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":1519995993966,"_cnpm_publish_time":1519995993966,"dist-tags":{"latest":"1.3.7"}}