browser.runtime
v1.0.4
Published
Native messaging browser.runtime implementation with nodejs
Downloads
5
Maintainers
Readme
browser.runtime
browser.runtime
implementation in nodejs.
See also Native Messaging.
Usage
npm install browser.runtime
const runtime = require('browser.runtime')
const port = runtime.connectNative(`${__dirname}/py_ping_pong`)
port.onMessage.addListener((response) => {
t.equal(response, 'pong')
port.disconnect()
})
port.postMessage('ping')
Transform streams
You can reuse low level transform streams to encode/decode messages:
const {NativeEncoder, NativeDecoder} = require('browser.runtime')
See tests.