yowjs
is a node module, distributed via NPM and allows you to easily intergrate yowsup
(Python library) into a node application. yowjs
is essantially an event
based proxy and allows you easily to communicate with yowsup
without any Python being involved.
Add yowjs
you your package.json file and install it via npm install. yowjs
is dependent on yowsup
and must be install manually.
npm install yowjs --save-dev
sudo easy_install yowsup2
const YowJS = require('yowjs');
let yowsup = new YowJS();
// init the connection params
yowsup.initialize(
config.countryCode,
config.phoneNumber,
config.password
)
.on('ON_MESSAGE', message => { // bind to incoming events from yowsup cli
console.log(['incoming msg', message]);
})
.on('LINK_DEAD', () => {
// re-init, connection lost
console.log('connection lost');
})
.connect(); // establish connection.
Clone this repo (or fork it)
git clone [email protected]:landrover/yowjs.git
Install deps
npm install
- comments