node-native-messaging-host
v1.0.5
Published
Simple Node Native Messaging Host =================================
Downloads
23
Maintainers
Readme
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