{"name":"sync-rpc","version":"1.3.7","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":"a75819e5295ca3c48864acfa60a20addf173c338","_id":"sync-rpc@1.3.7","bugs":{"url":"https://github.com/ForbesLindesay/sync-rpc/issues"},"homepage":"https://github.com/ForbesLindesay/sync-rpc#readme","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-YHciI7TUxL8EPqz/bg01sZfwuzQA0odao1wf1Ywdtw7j5vl30aQ6s+bLRTvgPPgzr94cg+WMm6Bxi/P7BJOxgw==","shasum":"a19a740cc726a1a394d986c3f90b86fc93e908e2","tarball":"http://registry-npm.ywwl.com/sync-rpc/download/sync-rpc-1.3.7.tgz","fileCount":11,"unpackedSize":14898,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBxUTzoMyXfSwulYhV4HII3AvXDNW809AkFcGiSuAcrLAiEAzfuHBiuuFQGsAEvW6RZ1xR92oH32PPOEOilxgOBLr1w="}],"size":5236,"noattachment":false,"key":"/sync-rpc/-/sync-rpc-1.3.7.tgz"},"_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"directories":{},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sync-rpc_1.3.7_1783092703186_0.06636188858143788"},"_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":1783092703348,"_cnpm_publish_time":1783092703348,"dist-tags":{"latest":"1.3.7"}}