npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

thingssdk-cli

v1.3.0

Published

Generator for JavaScript microcontroller projects

Downloads

3

Readme

thingsSDK CLI

Build Status codecov Dependency Status devDependency Status

thingsSDK CLI is a command line utility for generating and managing modern projects for JavaScript microcontroller runtimes.

Initial support is for Espruino with hopes to support others like Kinoma in the future.

Install CLI

$ npm install thingssdk-cli -g

Note that this project uses serialport, which compiles to binary. You might need to install some prerequesites depending on your operating system.

Prerequisites

Make sure prior to trying to push a project to your device, you flash the device with the Espruino Runtime with Flasher.js.

Usage

Plug your device in first and make sure you have the necessary drivers installed.

New Project

Next to create a new project use the new command like so:

$ thingssdk new path/to/project_name

You'll be prompted to enter plug your device in if you haven't already and then select the device's serial port and baud rate.

If you know your device's port and baud rate already, use the port and baud_rate options:

$ thingssdk new path/to/project_name --port=COM3 --baud_rate=115200

Getting Started with Your New Project

Your new project will now be found at path/to/project_name. You'll need to then install the dependencies.

$ npm install

dependencies in the new project package.json should be deployed to the device, devDependancies are what are used for your development workflow.

A devices.json file is created in the root of your new project. An entry is placed in your .gitignore because serial ports from computer to computer and developer to developer will differ.

Deploying it to Your Device

To run the "Hello, world" sample project to your device(s) run the npm script dev.

$ npm run dev

An interactive REPL will launch and you can interact with your code and debug your program. Once you're happy you can use delpoy to upload and save your code to the device.

$ npm run deploy

The "Hello, world" script can be found in main.js. This script gets uploaded to your device and blinks the blue LED on the ESP8266 board. It uses the devices.json file to know which devices to deploy the code to.

Your JavaScript program must implement a main function in order to be ran when the board is initialized.

Creating a devices.json file

To overwrite the current devices.json or create a new devices.json file in your project directory run the following command for an interactive prompt:

$ thingssdk devices

Or with the flags port and baud_rate if you know them already.

$ thingssdk devices --port=COM3 --baud_rate=115200

This will generate a devices.json like this:

{
  "devices": {
    "COM3": {
      "baud_rate": 115200,
      "runtime": "espruino"
    }
  }
}

Warning for Unix users: ~/

Due to cross-platform compatibility issues, ~ does not resolve to your home directory on Unix systems. For example, suppose:

$ pwd
/home/<your user name>/some/subdirectory

Running

$ thingssdk new ~/path/to/project_name

Would produce the following result:

$ ls ~/path/to/project_name
ls: cannot access '/home/<your user name>/path/to/project_name': No such file or directory

$ ls ~/some/subdirectory/~/path/to/project_name
main.js package.json scripts

This is probably not your intended behavior! So thingssdk throws an Error for paths beginning with ~, and a warning for paths containing ~ elsewhere.