
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@particle/node-example-helper
Advanced tools
Library for implementing simple node.js-based interactive command line tools that use the Particle API
Library for implementing simple node.js-based interactive command line tools that use the Particle API
The example node scripts have an optional configuration file, config.js, in the application directory. This is read by the main app using require. In most cases, this configuration is optional, or only requires the default values, and can prompt for things that are not specified in the file.
The prompting for configuration, for example which product to work with, is useful when running in Stackblitz.
The settings file, on the other hand, is a simple JSON file that's maintained by this helper for storing state temporarily. For example, you can enable storing a temporary authorization token in the settings.json file so you don't have to type it in every time you run the script. This is usually disabled by default, but is useful if you're writing your own script that you are going to be running a number of times.
There are utilities for prompting for strings, passwords, numbers, yes/no answers, and simple menus.
A single function call, helper.authenticate(), takes care of prompting for username (email), password, and MFA token (if enabled). This is more secure than storing the authentication token in the config.js file, though that is also supported for use cases where it makes sense to do so.
While not intended to replace particle-api-js, there are some useful functions in the helper. For example, you can retrieve the entire product device list at once, instead of paginated. This library doesn't actually use particle-api-js, it uses axios directly, however you can still use particle-api-js from your own scripts, as the device move and device provisioning sample scripts do.
This library is intended for use in a node.js environment (not a browser). It has one external dependency, axios, for doing Particle REST API calls. It also uses the node libraries fs, path, and readline. It requires node v12 or later.
The sample scripts like DeviceProvisioning and DeviceMove use it like this:
const helper = require('@particle/node-example-helper');
helper
.withRootDir(__dirname)
.withConfig(config);
Using the config file is optional. config is just an object that is read using require() in the main application.
FAQs
Library for implementing simple node.js-based interactive command line tools that use the Particle API
We found that @particle/node-example-helper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 23 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.