Skip to content

pyrho/node-native-messaging-host

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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