Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
arduino-cli
Advanced tools
A javascript wrapper over the arduino-cli tool
Works on Arduino-cli 0.3.1-alpha.preview
npm install -S arduino-cli
or yarn add arduino-cli
;import arduinoCli from 'arduino-cli';
arduino-cli
and config:
const cli = arduinoCli('/bin/arduino-cli', {
directories: {
user: '~/arduino-cli/sketches',
data: '~/arduino-cli/data',
},
});
It will create a config file for the arduino-cli
in your OS temp directory and pass it to any command you'll call later.cli.version().then(console.log); // "0.2.1-alpha.preview"
All commands runs asynchronously, so methods return Promise
s.
Returns the version of arduino-cli
. Wraps arduino-cli version
.
Promise<String>
Returns the current config of arduino-cli
as a plain JS object. Wraps arduino-cli config dump
.
Promise<Object>
Replaces old config with the new one.
Accepts:
newConfig
<Object>
— Plain JS object representation of .cli-config.yml
Returns <Object>
with the new config
A wrapper with a custom extension over arduino-cli board list
.
Custom extension may be removed in the future. See issue #45
Returns a plain JS object which describes boards connected through serial ports. Also, it extends boards' FQBN with cpu
option from boards.txt
if a board is identified (a package installed) and has some options. For example, Arduino Nano
will be transformed into three items with a modified FQBN and name.
Promise<Array<ConnectedBoard>>
A wrapper with a custom extension over arduino-cli board listall
.
Custom extension may be removed in the future. See issue #45
Returns a plain JS object with boards, whose packages are installed. Also, it extends boards' FQBN with cpu
option from boards.txt
if a board is identified (a package installed) and it has some options. For example, Arduino Nano
will be transformed into three items with a modified FQBN and name.
Promise<Array<InstalledBoard>>
Returns a list of all boards that found in all package_*_index.json
files.
Promise<Array<AvailableBoard>>
Sets a list of additional package index urls into the config file. Later you can download and install packages with arduino-cli
(call core.updateIndex()
).
Accepts:
urls
<Array<String>>
— List of URLs of the third-party package_*_index.json
files
Returns Promise<Array<String>>
with just added URLs
Wraps arduino-cli core download packageName
. Downloads core and tool archives for the specified package.
Accepts:
progressCallback
<Function>
— A function that will be called on progress with one argument <ProgressData>
. See details below.
packageName
<String>
— A package and architecture to download. May contain a version. For example, arduino:avr
or arduino:avr@1.6.9
Returns Promise<String>
— log
Wraps arduino-cli core install packageName
. Downloads and installs core and tool archives for the specified package.
Accepts:
progressCallback
<Function>
— A function that will be called on progress with one argument <ProgressData>
. See details below.
packageName
<String>
— A package and architecture to install. May contain a version. For example, arduino:avr
or arduino:avr@1.6.9
Returns Promise<String>
— log
Wraps arduino-cli core list
. Returns a list of installed packages.
Promise<Array<InstalledPackages>>
Wraps arduino-cli core search query
. Returns a list of packages found.
Accepts:
query
<String>
— A search query
Returns Promise<Array<FoundPackages>>
Wraps arduino-cli core uninstall packageName
. Uninstalls the core and tools for the specified package.
Accepts:
packageName
<String>
— A package identifier, like arduino:samd
Returns Promise<String>
— a log
Wraps arduino-cli core update-index
. Downloads the original package_index.json
and additional package index files.
Promise<String>
— a logWraps arduino-cli sketch new sketchName
. Creates an empty sketchName/sketchName.ino
inside the sketchbook directory.
Promise<String>
— a full path to the created .ino
fileWraps arduino-cli compile
. Compiles the sketch for the specified board.
Accepts:
onProgress
<Function>
— A function that is called on new data in stdout
fqbn
<String>
— A fully-qualified board name. Like arduino:avr:mega:cpu=atmega2560
sketchName
<String>
— A name of the sketch in the sketchbook directory. It can contain sketch name or full path to the sketch.
verbose
<Boolean>
— Verbose output. By default is false
Returns Promise<String>
with a log of the compilation process
Wraps arduino-cli upload
. Uploads the compiled sketch onto the board.
Accepts:
onProgress
<Function>
— A function that is called on new data in stdout
with a single argument
port
<String>
— A port name (e.g., COM3
or /dev/tty.usbmodem1411
)
fqbn
<String>
— A fully-qualified board name. Like arduino:avr:mega:cpu=atmega2560
sketchName
<String>
— A name of the sketch in the sketchbook directory. It can contain sketch name or full path to the sketch.
verbose
<Boolean>
— Verbose output. By default is false
Returns Promise<String>
with a log of the upload process
Returns a list of running arduino-cli
processes.
Array<ChildProcess>
Kills all running arduino-cli
processes.
Boolean
true
name
<String>
— A board name with an added cpu option, if it exists For example, "Arduino/Genuino Uno" or "Arduino/Genuino Mega2560 (ATmega2560 (Mega 2560))"fqbn
<String>
— A fully-qualified board name For example, arduino:avr:uno
or arduino:avr:mega2560:cpu=atmega2560
port
<String>
— A port name. Like /dev/tty.usbmodem1411
usbID
String
— An ID of the board (VID, PID). For example, 2341:0042
name
<String>
— A board name E.G. "Arduino/Genuino Uno" or "Arduino/Genuino Mega2560"fqbn
<String>
— A fully-qualified board name E.G. "arduino:avr:uno" or "arduino:avr:mega2560"options
<Array<Option>>
— a list of options for this boardObject, that represents one group of the board option. For example, CPU Frequency.
optionName
<String>
— A human-readable name of the option group ("CPU Frequency")optionId
<String>
— An id of the option from boards.txt
. E.G. CpuFrequency
values
<Array<OptionValue>>
— a list of option values, that represented as objects with two fields
name
<String>
— A human-readable option name ("80 MHz")value
<String>
— A value, that will be used by tools. ("80")name
<String>
— A board name (e.g., "Arduino/Genuino Mega2560")package
<String>
— A package and architecture, that could be used in the core.install
command. For example, arduino:avr
packageName
<String>
— A human-readable architecture name. Like "Arduino AVR Boards"version
<String>
— A Semver of the latest architecture for this board (e.g., 1.6.21
)message
<String>
— A progress message from stdout of the arduino-cli
. In case that there is a downloading process that shows progress bar, it will be null
, because this type of progress should notify only about a percentage.percentage
<Number>
— A number in the range [0.00...100.00]estimated
<String>
— An estimated time in the format 3m52s
or unknown
ID
<String>
— A package identifier in format package:architecture
(e.g., arduino:avr
)Installed
<String>
— A version of the installed packageLatest
<String>
— A version of the latest packageName
<String>
— A human-readable name of the architectureID
<String>
— A package identifier in format package:architecture
(e.g., arduino:avr
)Version
<String>
— A version of the latest packageInstalled
<String>
— Equals "Yes" if the package is installed, otherwise "No"Name
<String>
— A name of the architectureFAQs
JS-wrapper over arduino-cli
We found that arduino-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.