hadouken-js-adapter
Allows the use of the Hadouken API from node.js.
Last updated 2 months ago by rdepena .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hadouken-js-adapter 
SYNC missed versions from official npm registry.

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

Connecting to an already running runtime

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

async function launchApp() {
    const fin  = await connect({
        address: "ws://localhost:9696",
        uuid: "my-uuid-123"
    });

    const version = await fin.System.getVersion();
    console.log("Connected to Hadouken version", version);

    const app = await fin.Application.create({
	name: "adapter-test-app",
	url: 'http://hadouken.io/',
	uuid: "adapter-test-app",
	autoShow: true,
	nonPersistent : true
    });

    await app.run();
}

launchApp().then(() => {
    console.log("success");
}).catch((err) => {
    console.log("Error trying to connect,", err.message);
    console.log(err.stack);
});

Launching a runtime and connecting

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

async function launchApp() {
    const fin  = await connect({
        uuid: "my-uuid-123",
        runtime: {
            version: 'stable'
        }
    });

    const version = await fin.System.getVersion();
    console.log("Connected to Hadouken version", version);

    const app = await fin.Application.create({
        name: "adapter-test-app",
        url: 'http://hadouken.io/',
        uuid: "adapter-test-app",
        autoShow: true,
        nonPersistent : true
    });

    await app.run();
}

launchApp().then(() => {
    console.log("success");
}).catch((err) => {
    console.log("Error trying to connect,", err.message);
    console.log(err.stack);
});

Note that either an address or a runtime object with version are required to connect

Mac and Linux Environment settings

In order to configure system policies, the js adapter respects the following group policy settings when set as environment variables on Mac and Linux:

  • assetsUrl
  • runtimeArgs
  • runtimeDirectory

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"

Test with core

npm test -- --ver=alpha --build-core --core=~/core

or without specifying the core path (core will be cloned from GH into core directory):

npm test -- --ver=alpha --build-core

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

Current Tags

  • 0.36.1-alpha.1                                ...           latest (2 months ago)

25 Versions

  • 0.36.1-alpha.1                                ...           2 months ago
  • 0.35.1-alpha.2                                ...           2 months ago
  • 0.35.1-alpha.1                                ...           2 months ago
  • 0.34.4                                ...           3 months ago
  • 0.34.3                                ...           3 months ago
  • 0.31.3                                ...           3 months ago
  • 0.34.2                                ...           3 months ago
  • 0.34.1                                ...           3 months ago
  • 0.34.1-alpha.3                                ...           3 months ago
  • 0.34.1-alpha.2                                ...           4 months ago
  • 0.34.1-alpha.1                                ...           4 months ago
  • 0.32.1-alpha.5                                ...           5 months ago
  • 0.32.1-alpha.4                                ...           5 months ago
  • 0.32.1-alpha.3                                ...           5 months ago
  • 0.32.1-alpha.2                                ...           6 months ago
  • 0.32.1-alpha.1                                ...           6 months ago
  • 0.31.1                                ...           6 months ago
  • 0.30.2                                ...           8 months ago
  • 0.30.1                                ...           8 months ago
  • 0.2.2                                ...           10 months ago
  • 0.2.1                                ...           10 months ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (21)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |