UNPKG

@inst/vscode-bin-darwin

Version:

BINARY ONLY - VSCode binary deployment for macOS

102 lines (101 loc) 6.59 kB
{ "_args": [ [ { "raw": "noice-json-rpc@https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "scope": null, "escapedName": "noice-json-rpc", "name": "noice-json-rpc", "rawSpec": "https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "spec": "https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "type": "remote" }, "/Users/roblou/code/vscode-node-debug2" ] ], "_from": "noice-json-rpc@>=1.0.0 <2.0.0", "_id": "noice-json-rpc@1.0.1", "_inCache": true, "_location": "/noice-json-rpc", "_phantomChildren": {}, "_requested": { "raw": "noice-json-rpc@https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "scope": null, "escapedName": "noice-json-rpc", "name": "noice-json-rpc", "rawSpec": "https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "spec": "https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "type": "remote" }, "_requiredBy": [ "/", "/vscode-chrome-debug-core" ], "_resolved": "https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "_shasum": "5e7289a60a1c20880489cb15101552bac392266e", "_shrinkwrap": null, "_spec": "noice-json-rpc@https://registry.npmjs.org/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz", "_where": "/Users/roblou/code/vscode-node-debug2", "author": { "name": "nojvek" }, "bugs": { "url": "https://github.com/nojvek/noice-json-rpc/issues" }, "dependencies": {}, "description": "Noice Json RPC exposes a clean ES6 Proxy and Promise based interface for JSON-RPC2 Clients and Servers", "devDependencies": { "@types/chai": "^3.4.34", "@types/mocha": "^2.2.32", "@types/node": "^6.0.43", "@types/sinon": "^1.16.31", "@types/ws": "0.0.34", "chai": "^3.5.0", "chrome-remote-debug-protocol": "^1.0.1", "coveralls": "^2.11.11", "istanbul": "^0.4.5", "mocha": "^2.5.3", "sinon": "^1.17.4", "tslint": "^3.15.1", "typescript": "^2.0.3", "ws": "^1.1.1" }, "files": [ "lib" ], "homepage": "https://github.com/nojvek/noice-json-rpc#readme", "keywords": [ "noice", "json", "rpc", "rpc2", "es6", "proxy", "promises", "api", "server", "client" ], "license": "MIT", "main": "lib/noice-json-rpc.js", "name": "noice-json-rpc", "optionalDependencies": {}, "readme": "# Noice Json Rpc\n[![Build Status](https://img.shields.io/travis/nojvek/noice-json-rpc/master.svg)](https://travis-ci.org/nojvek/noice-json-rpc)\n[![Coverage Status](https://img.shields.io/coveralls/nojvek/noice-json-rpc/master.svg)](https://coveralls.io/github/nojvek/noice-json-rpc?branch=master)\n[![issues open](https://img.shields.io/github/issues/nojvek/noice-json-rpc.svg)](https://github.com/nojvek/noice-json-rpc/issues)\n[![npm total downloads](https://img.shields.io/npm/dt/noice-json-rpc.svg?maxAge=2592000)](https://www.npmjs.com/package/noice-json-rpc)\n[![licence](https://img.shields.io/npm/l/noice-json-rpc.svg?maxAge=2592000)](https://github.com/nojvek/noice-json-rpc)\n[![npm version](https://img.shields.io/npm/v/noice-json-rpc.svg)](https://www.npmjs.com/package/noice-json-rpc)\n\nClient and Server helpers to implement a clean function based Api for Json Rpc.\n\nNoice Json Rpc takes in a websocket like object. It calls `send(msg:str)` function and expects messages to come from `on('message', handler)`. It works out of the box with WebSockets but it can also work with stdin/stdout, worker threads, iframes or any other mechanism in which strings can be sent or received. \n\nIts only dependency is `events.EventEmitter`.\n\nUsing ES6 proxies it exposes a clean client-server api. Since its written in TypeScript, the api object can be cast to work off an interface specific to the domain. e.g [chrome-remote-debug-protocol](https://github.com/nojvek/chrome-remote-debug-protocol) \n\n## [Example](tests/example.ts)\n\n```js\nimport * as WebSocket from 'ws'\nimport WebSocketServer = WebSocket.Server\nimport * as rpc from 'noice-json-rpc'\n\nasync function setupClient() {\n try {\n const api = new rpc.Client(new WebSocket(\"ws://localhost:8080\"), {logConsole: true}).api()\n\n await Promise.all([\n api.Runtime.enable(),\n api.Debugger.enable(),\n api.Profiler.enable(),\n api.Runtime.run(),\n ])\n\n await api.Profiler.start()\n await new Promise((resolve) => api.Runtime.onExecutionContextDestroyed(resolve)); // Wait for event\n await api.Profiler.stop()\n\n } catch (e) {\n console.error(e)\n }\n}\n\nfunction setupServer() {\n const wssServer = new WebSocketServer({port: 8080});\n const api = new rpc.Server(wssServer).api();\n\n const enable = () => {}\n\n api.Debugger.expose({enable})\n api.Profiler.expose({enable})\n api.Runtime.expose({\n enable,\n run() {}\n })\n api.Profiler.expose({\n enable,\n start() {\n setTimeout(() => {\n api.Runtime.emitExecutionContextDestroyed()\n }, 1000)\n },\n stop() {\n return {data: \"noice!\"}\n }\n })\n\n}\n\nsetupServer()\nsetupClient()\n```\n\nOutput\n\n```\nClient > {\"id\":1,\"method\":\"Runtime.enable\"}\nClient > {\"id\":2,\"method\":\"Debugger.enable\"}\nClient > {\"id\":3,\"method\":\"Profiler.enable\"}\nClient > {\"id\":4,\"method\":\"Runtime.run\"}\nClient < {\"id\":1,\"result\":{}}\nClient < {\"id\":2,\"result\":{}}\nClient < {\"id\":3,\"result\":{}}\nClient < {\"id\":4,\"result\":{}}\nClient > {\"id\":5,\"method\":\"Profiler.start\"}\nClient < {\"id\":5,\"result\":{}}\nClient < {\"method\":\"Runtime.executionContextDestroyed\"}\nClient > {\"id\":6,\"method\":\"Profiler.stop\"}\nClient < {\"id\":6,\"result\":{\"data\":\"noice!\"}}\n```\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+ssh://git@github.com/nojvek/noice-json-rpc.git" }, "scripts": { "build": "tsc -p src", "clean": "rm -rf lib && rm -rf test", "coveralls": "cat coverage/lcov.info | node_modules/.bin/coveralls", "example": "node out/example.js", "mocha-debug": "mocha --debug-brk -R spec out/*.test.js", "pretest": "tsc -p tests", "test": "istanbul cover node_modules/.bin/_mocha -- -R spec out/*.test.js", "tslint": "tslint -c tslint.json src/*.ts tests/*.ts" }, "typings": "lib/noice-json-rpc.d.ts", "version": "1.0.1" }