pbaize / js-adapter

Hadouken Node Adapter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hadouken Node.js adapter Build Status

Allows the use of the Hadouken API from node.js.

Requirements

  • Node.js LTS ^6.9

Install as dependency

$ npm install -S hadouken-js-adapter

Usage

const { connect, Identity } = require("hadouken-js-adapter");

connect({
    address: "ws://localhost:9696",
    uuid: "my-uuid-123"
}).then(logic).catch(connError);

function logic(fin) {

    fin.System.getVersion().then(v => console.log("Connected to Hadouken version", v));
    let win;
    fin.Window.wrap({
        uuid: "remote-app-uuid",
        name: "remote-window-name"
    }).then(w => { win = w; win.moveBy(500, 0)).then(win.flash());

}

function connError(err) {

    console.log("Error trying to connect,", err.message);

    console.log(err.stack);
}

Local build

npm run build

Test

npm test -- --ver=alpha

Only executing tests that pattern match "Application"

npm test -- --ver=alpha --grep="Application"

Executing tests that do not pattern match "System"

npm test -- --ver=alpha --invert --grep="System"

Repl

To start the read-eval-print loop:

npm run repl -- --ver=alpha

Generated documentation

We use JSDoc for documentation and generating the documentation will require our custom JSDoc template. Use the following commands to execute the docs task:

git submodule init
git submodule update
npm run doc

About

Hadouken Node Adapter

License:Apache License 2.0


Languages

Language:TypeScript 97.3%Language:JavaScript 2.2%Language:HTML 0.5%