New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@particle/device-constants

Package Overview
Dependencies
Maintainers
0
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@particle/device-constants

static device identifiers and meta-data for Particle hardware

  • 3.8.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
535
decreased by-61.68%
Maintainers
0
Weekly downloads
 
Created
Source

Particle Device Constants

The static device identifiers and meta-data for Particle hardware.

This project contains the constants as well as very lightweight wrappers around the constants and enables publishing them as NPM modules and Ruby Gems. All languages' libraries follow the same versioning scheme.

CI

Installation | Development | Releasing

Installation

  1. Install Node.js [node@16.x and npm@8.x are required]
  2. Clone this repository $ git clone git@github.com:particle-iot-inc/device-constants.git && cd ./device-constants
  3. Install dependencies $ npm install
    • make sure you are signed into npm and a member of the @particle org (docs)
  4. View available commands $ npm run
  5. Run the tests $ npm test
  6. Start Hacking!

Development

The Device Constants repo contains static specs for official Particle platform devices and the tooling to support publishing a series of language-specific packages with that data. All essential commands are available via npm run <script name> - e.g. npm run lint. To view the available commands, run: npm run

How to add a new platform

To add a new Particle platform device, simply:

  1. Open the src/constants.json file in your favorite code editor
  2. Add a new entry like:
"example": {
	"id": <integer - the unique identifier>,
	"name": <string - the unique name used by Device OS' build system>,
	"displayName": <string - human-facing platform name>,
	"generation": <integer - e.g. `2` for photon, `3` for boron, `4` for p2>,
	"features": <array of strings - the features supported e.g. `wifi`, `ble`>,
	"billingConnectivity": <string for where data ops for this device type should be counted e.g. `wifi`, or `cellular``>,
	"public": <boolean - whether or not the platform is available to end-users>
},

NOTE: See src/constants.schema.json for latest field definitions

  1. Validate your additions adhere to the current schema: npm run validate
  2. Stage and commit: git add -p && git commit

How to extend the device schema

Constants data must adhere to the JSON Schema (https://json-schema.org) specs in src/constants.schema.json. In some cases, you may need to extend the current schema to support addition properies, etc. To do that:

  1. Read through the "Getting Started" docs
  2. Open the src/constants.schema.json file in your favorite code editor
  3. Update the schema with your additions or changes - in some cases, you can jumpstart the process using the online generator at: https://www.jsonschema.net but be sure to scrutinize what it provides as it's not always super-accurate :)
  4. Validate your changes have not rendered existing data invalid: npm run validate
  5. Stage and commit: git add -p && git commit

Making changes to the ruby wrapper

See the src/ruby/README.md file for more info on the Ruby Gem wrapper.

Releasing

Packages are only released from the main branch after peer review.

  1. make sure you have the latest:
    • $ git checkout main
    • $ git pull
  2. make sure tests pass
    • $ npm test
  3. run the release command
    • $ npm run release
  4. follow the on-screen instructions, wait for confirmation of success
  5. push your tags:
    • $ git push origin main --follow-tags

FAQs

Package last updated on 10 Feb 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc