
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Retrieve AQI (with AQandU conversion) from a PurpleAir sensor via the CLI or as a library to your node script
Retrieve AQI (with AQandU conversion) from a PurpleAir sensor via the CLI or as a library to your node script
Most of this code was stolen from https://aqi.wtf
Open the PurpleAir map: https://www.purpleair.com/map?mylocation
and click on the sensor closest to your location.
The URL bar will change to something like:
https://www.purpleair.com/map?opt=1/mAQI/a10/cC0&select=62217#15.69/37.737125/-122.414218
The sensor ID will be the value of the select
parameter. In the above URL, the ID is 62217:
https://www.purpleair.com/map?opt=1/mAQI/a10/cC0&select=
62217
#15.69/37.737125/-122.414218
Install the module globally
npm install -g purpleair
Then call:
purpleair [sensor ID]
which will return the AQI.
Example output:
> purpleair 62217
139
With the AQI class:
> purpleair --class 62217
139 (unhealthy-for-sensitive-groups)
As JSON:
> purpleair --class --json 62217
{
"aqi": 139,
"sensorId": 62217,
"class": "unhealthy-for-sensitive-groups"
}
There are three functions:
Example:
const purpleair = require('purpleair');
const main = async () => {
try {
var sensor = await purpleair.getSensor(62217);
var aqi = await purpleair.getAQI(sensor);
console.log(aqi);
var aqiClass = purpleair.getAQIClass(aqi);
console.log(aqiClass);
} catch (err) {
console.error(err);
}
};
main();
MIT
FAQs
Retrieve AQI (with AQandU conversion) from a PurpleAir sensor via the CLI or as a library to your node script
The npm package purpleair receives a total of 2 weekly downloads. As such, purpleair popularity was classified as not popular.
We found that purpleair demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.