Skip to content

Latest commit

 

History

History
108 lines (66 loc) · 2.66 KB

README.md

File metadata and controls

108 lines (66 loc) · 2.66 KB

Arduino Node

Travis CI Codecov npm npm version npm dependencies npm dev dependencies

🎁 Cross-Platform Arduino IDE in nodeJS

Install

$ npm install --save arduino-node

Usage

const arduino = require('arduino-node');

const arduLatest = arduino({path: 'bin'});

arduLatest.run(['--verify', './your-project/your-project.ino'], (err, out) => {
  if (err) {
    console.log(err);
    return;
  }
  console.log(out.stdout);
});

const ardu180 = arduino({path: 'bin', version: '1.8.0'});

ardu180.run(['--verify', './your-project/your-project.ino'], (err, out) => {
  if (err) {
    console.log(err);
    return;
  }
  console.log(out.stdout);
});

API

arduino(options)

Creates a new arduino instance.

options

Type: object

version

Type: string
Default: 'latest'

The Arduino IDE version to use.

path

Type: string
Default: 'bin'

The path where Arduino IDE will resides.

.run([arguments], callback)

Runs the Arduino IDE binary. If the binary is not loaded it will also load it.

arguments

Type: array
Default: []

An array of arguments to pass to the Arduino IDE.

callback(err, out)

Type: function

Returns a possible error and the output object.

.load(callback)

Runs the search for the Arduino IDE binary. If no binary is found it will download it from arduino-version.

callback(err)

Type: function

.unload(callback)

Removes downloaded Arduino IDE binary, if present.

callback(err)

Type: function

.bin()

Returns the full path to the Arduino IDE binary.

.path()

Returns the full path where the Arduino IDE will downloaded to.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.