arcgis-lib-downloader
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -1,67 +0,71 @@ | ||
'use strict' | ||
module.exports = (name = 'User') => { | ||
return `Hello, ${name}!` | ||
} | ||
// variables | ||
const program = require('commander') | ||
const fetch = require('node-fetch') | ||
const myTable = require('table') | ||
program.version('1.0.3') | ||
let url = "https://developers.arcgis.com/data/downloads.json" | ||
let settings = { method: "Get" }; | ||
// 'use strict' | ||
// initializing array we will be using for creation of table | ||
let data = new Array() | ||
let firstLine = ['Key', 'Name', 'Latest Version', 'Other Versions'] | ||
data.push(firstLine) | ||
// // variables | ||
// const program = require('commander') | ||
// const fetch = require('node-fetch') | ||
// const myTable = require('table') | ||
// program.version('1.0.3') | ||
// let url = "https://developers.arcgis.com/data/downloads.json" | ||
// let settings = { method: "Get" }; | ||
// function actually used to make the table | ||
function makeTable() { | ||
// fetch data from url | ||
fetch(url, settings) | ||
.then(res => res.json()) | ||
.then((json) => { | ||
// extract data from .json file and add it to proper position in | ||
// various arrays we will be using | ||
for (var key in json) { | ||
let rowData = new Array() | ||
let extractedName = json[key].name | ||
rowData.push(extractedName) | ||
let extractedProductName = json[key].product_name | ||
rowData.push(extractedProductName) | ||
let extractedCurrVersion = json[key].current_version | ||
rowData.push(extractedCurrVersion) | ||
let extractedDownloads = json[key].downloads | ||
let keyDownloads = new Array() | ||
for (var d in extractedDownloads) { | ||
keyDownloads.push(d) | ||
} | ||
rowData.push(keyDownloads) | ||
data.push(rowData) | ||
} | ||
// configuring what the table will look like | ||
const config = { | ||
columns: { | ||
1: { width: 10, wrapWord: true }, | ||
2: { width: 10, wrapWord: true }, | ||
3: { width: 10, wrapWord: true }, | ||
4: { width: 10, wrapWord: true } | ||
} | ||
}; | ||
// // initializing array we will be using for creation of table | ||
// let data = new Array() | ||
// let firstLine = ['Key', 'Name', 'Latest Version', 'Other Versions'] | ||
// data.push(firstLine) | ||
// printing out the actual table | ||
console.log(myTable.table(data, config)) | ||
}) | ||
} | ||
// // function actually used to make the table | ||
// function makeTable() { | ||
// // fetch data from url | ||
// fetch(url, settings) | ||
// .then(res => res.json()) | ||
// .then((json) => { | ||
// // extract data from .json file and add it to proper position in | ||
// // various arrays we will be using | ||
// for (var key in json) { | ||
// let rowData = new Array() | ||
// let extractedName = json[key].name | ||
// rowData.push(extractedName) | ||
// let extractedProductName = json[key].product_name | ||
// rowData.push(extractedProductName) | ||
// let extractedCurrVersion = json[key].current_version | ||
// rowData.push(extractedCurrVersion) | ||
// let extractedDownloads = json[key].downloads | ||
// let keyDownloads = new Array() | ||
// for (var d in extractedDownloads) { | ||
// keyDownloads.push(d) | ||
// } | ||
// rowData.push(keyDownloads) | ||
// data.push(rowData) | ||
// } | ||
// // configuring what the table will look like | ||
// const config = { | ||
// columns: { | ||
// 1: { width: 10, wrapWord: true }, | ||
// 2: { width: 10, wrapWord: true }, | ||
// 3: { width: 10, wrapWord: true }, | ||
// 4: { width: 10, wrapWord: true } | ||
// } | ||
// }; | ||
// making the option to be able to print out the table of products | ||
program | ||
.option('-lp, --list-products', 'Print out table with ArcGIS prodcuts' | ||
, makeTable) | ||
// // printing out the actual table | ||
// console.log(myTable.table(data, config)) | ||
// }) | ||
// } | ||
program.parse() | ||
// // making the option to be able to print out the table of products | ||
// program | ||
// .option('-lp, --list-products', 'Print out table with ArcGIS prodcuts' | ||
// , makeTable) | ||
const options = program.opts() | ||
if (options.listproducts !== undefined) options.listproducts | ||
// program.parse() | ||
module.exports = { | ||
makeTable: makeTable | ||
} | ||
// const options = program.opts() | ||
// if (options.listproducts !== undefined) options.listproducts | ||
// module.exports = { | ||
// makeTable: makeTable | ||
// } |
{ | ||
"name": "arcgis-lib-downloader", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "npm package for gaining access to ArcGIS programs", | ||
@@ -20,3 +20,3 @@ "main": "app.js", | ||
"author": "Jansen Comadena", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -23,0 +23,0 @@ "url": "https://github.com/EsriPS/arcgis-lib-downloader/issues" |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
4449
84
0