项目作者: Mobsya

项目描述 :
Sample code show casing the use of the javascript api for thymio
高级语言: JavaScript
项目地址: git://github.com/Mobsya/thymio-js-api-demo.git
创建时间: 2018-07-04T08:04:22Z
项目社区:https://github.com/Mobsya/thymio-js-api-demo

开源协议:Apache License 2.0

下载


thymio-js-api-demo

This simple javascript application showcases how to use the Thymio API from a browser or a node-based app

Getting started

Install the switch

TODO

Install npm

Npm is a package manager for JavaScript, you will need it to work with the Thymio API

Learn more here.

Note that despite depending on Node to install and build the Thymio JS API, it is fully compatible with browsers
and Node.

Install the dependencies

Run npm i in the cloned directory to install the required dependencies.

Launch the web app

Run npm run browser, then open dist/index.html in your browser.
The web-based version outputs in the browser’s console.

Launch the Node-based application

Run npm start

How does it work?

The thymio API is distributed as a @mobsya-association/thymio-api">npm package.
It can be installed with npm -i @mobsya-association/thymio-api.

This demo project also depends on:

  • Webpack to orchestrate the bundling of the application for both node and browser
  • Babel to convert the code in a flavor of Javascript compatible with older versions of web browsers

The code is in src and gets compiled into dist.

What next.

You can copy this project or get inspiration from it to start working on web-applications compatible with thymio.