node-native-messaging-host

1.0.5 • Public • Published

Simple Node Native Messaging Host

A native messaging host for Chrome and Firefox with a simple API and no dependencies.

Install

npm i node-native-messaging-host

Usage

import initNativeMessagingHost from 'node-native-messaging-host';
 
// Initialize
const nm = initNativeMessagingHost();
 
// Add a callback that will be fired each time a new message is
// received from the extension.
nm.addOnMessageListener(message => {
    console.log(`Received ${message} from extension`);
});
 
 
// Send a message to the extension
nm.send({ answer: 42 });

Used by

Todo

  • tests

Package Sidebar

Install

npm i node-native-messaging-host

Weekly Downloads

4

Version

1.0.5

License

Unlicense

Unpacked Size

5.79 kB

Total Files

5

Last publish

Collaborators

  • pyrho