![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
noice-json-rpc
Advanced tools
Readme
Client and Server helpers to implement a clean function based Api for Json Rpc.
Noice 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.
Its only dependency is events.EventEmitter
.
Using 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 ChromeDevTools/devtools-protocol
import * as WebSocket from 'ws'
import DevToolsProtocol from 'devtools-protocol'
import * as rpc from '../lib/noice-json-rpc'
async function setupClient() {
try {
const rpcClient = new rpc.Client(new WebSocket('ws://localhost:8080'), {logConsole: true})
const api: DevToolsProtocol.ProtocolApi = rpcClient.api()
await Promise.all([
api.Runtime.enable(),
api.Profiler.enable(),
])
await api.Runtime.run()
await api.Profiler.start()
await new Promise(resolve => api.Runtime.on('executionContextDestroyed', resolve)); // Wait for event
const result = await api.Profiler.stop()
console.log('Result', result)
} catch (e) {
console.error(e)
}
}
setupClient()
Output
Client > {"id":1,"method":"Runtime.enable"}
Client > {"id":3,"method":"Profiler.enable"}
Client > {"id":4,"method":"Runtime.run"}
Client < {"id":1,"result":{}}
Client < {"id":2,"result":{}}
Client < {"id":3,"result":{}}
Client < {"id":4,"result":{}}
Client > {"id":5,"method":"Profiler.start"}
Client < {"id":5,"result":{}}
Client < {"method":"Runtime.executionContextDestroyed"}
Client > {"id":6,"method":"Profiler.stop"}
Client < {"id":6,"result":{"data":"noice!"}}
FAQs
Noice Json RPC exposes a clean ES6 Proxy and Promise based interface for JSON-RPC2 Clients and Servers
We found that noice-json-rpc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.