browser.runtime

1.0.4 • Public • Published

browser.runtime

Build Status

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.

Package Sidebar

Install

npm i browser.runtime

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

7.5 kB

Total Files

9

Last publish

Collaborators

  • soyuka