Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

purpleair

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

purpleair - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

26

cli.js

@@ -9,2 +9,7 @@ #!/usr/bin/env node

})
.option('j', {
alias: 'json',
type: 'boolean',
desc: 'Output as JSON'
})
.demandCommand(1)

@@ -15,15 +20,30 @@ .argv;

libAqi.getSensor(argv._[0]).then(async function (sensor) {
var sensorId = argv._[0];
libAqi.getSensor(sensorId).then(async function (sensor) {
var aqi = await libAqi.getAQI(sensor);
var output = aqi;
aqiClass = null;
if (argv.class) {
var aqiClass = libAqi.getAQIClass(aqi);
aqiClass = libAqi.getAQIClass(aqi);
output = `${aqi} (${aqiClass})`;
}
console.log(output);
if (argv.json) {
var outputJson = {
aqi: aqi,
sensorId: sensorId,
};
if (aqiClass) {
outputJson.class = aqiClass;
}
console.log(JSON.stringify(outputJson, null, 2));
} else {
console.log(output);
}
}).catch(err => {
console.error(err);
});

2

package.json
{
"name": "purpleair",
"version": "1.0.3",
"version": "1.0.4",
"description": "Retrieve AQI (with AQandU conversion) from a Purpleair sensor via the CLI or as a library to your node script",

@@ -5,0 +5,0 @@ "keywords": ["purple air", "purpleair", "aqi", "aqandu"],

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