synthetix-data
Advanced tools
Comparing version 2.1.40 to 2.1.41
20
bin.js
@@ -20,4 +20,10 @@ #!/usr/bin/env node | ||
const logResults = ({ json } = {}) => results => { | ||
console.log(json ? JSON.stringify(results, null, 2) : results); | ||
const logResults = ({ json, csv } = {}) => results => { | ||
if (json) { | ||
console.log(JSON.stringify(results, null, 2)); | ||
} else if (csv) { | ||
stringify(results, { header: true }).pipe(process.stdout); | ||
} else { | ||
console.log(results); | ||
} | ||
return results; | ||
@@ -326,3 +332,3 @@ }; | ||
.option('-t, --to <value>', 'A to address') | ||
.option(',m, --max <value>', 'Maximum number of results', 100) | ||
.option('-m, --max <value>', 'Maximum number of results', 100) | ||
.action(async ({ from, to, max }) => { | ||
@@ -338,10 +344,10 @@ snx | ||
.option('-a, --addresses-only', 'Show addresses only') | ||
.option('-m, --max <value>', 'Maximum number of results', Infinity) | ||
.option('-m, --max <value>', 'Maximum number of results', 100) | ||
.option('-j, --json', 'Whether or not to display the results as JSON') | ||
.action(async ({ max, json, addressesOnly }) => { | ||
.option('-c, --csv', 'Whether or not to display the results as a CSV') | ||
.action(async ({ max, json, addressesOnly, csv }) => { | ||
snx | ||
.rewards({ max }) | ||
.then(results => (addressesOnly ? results.map(({ address }) => address) : results)) | ||
.then(logResults({ json })) | ||
.then(logResults({ json, csv })) | ||
.then(showResultCount({ max })); | ||
@@ -348,0 +354,0 @@ }); |
{ | ||
"name": "synthetix-data", | ||
"license": "MIT", | ||
"version": "2.1.40", | ||
"version": "2.1.41", | ||
"author": "Synthetix", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7524666
253760