Skip to content
shundroid edited this page Jul 17, 2016 · 2 revisions

Welcome to the sphero-websocket wiki!

Sphero-Websocket

使い方

1. グローバルインストールして使う

$ npm install -g sphero-websocket
$ sphero-websocket

sphero-websocket コマンドが使えるようになり、それにより実行ができます。
このとき、config は、カレントディレクトリにある sphero-ws-config.js が使用されます。

2. require して使う

$ npm install sphero-websocket
var spheroWebSocket = require("sphero-websocket");
var spheroWS = spheroWebSocket({
  // config
});

このときの config は、関数の引数が使用されます。
また、この方法により、sphero-websocket の API を使用することが可能です。