diff --git a/package.json b/package.json index 29a39cd..2b35940 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,9 @@ { + "name": "deblan-scraper", + "description": "Web scraper using CSS selector", + "version": "1.0.0", + "main": "src/index.js", + "devDependencies": {}, "dependencies": { "cheerio": "^1.0.0-rc.3", "extends-classes": "^1.0.5", @@ -6,5 +11,17 @@ "request-promise": "^4.2.5", "striptags": "^3.1.1", "trim": "^0.0.1" - } + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://gitnet.fr/deblan/scraper.git" + }, + "keywords": [ + "scraper" + ], + "author": "Simon Vieille (https://www.deblan.io)", + "license": "ISC" } diff --git a/src/console/input.js b/src/console/input.js index 0774fab..1aece10 100644 --- a/src/console/input.js +++ b/src/console/input.js @@ -9,9 +9,9 @@ class Input { * @param object process */ constructor(process) { - this.args = Minimist(process.argv.slice(2)); - this.node = process.argv[0]; - this.script = process.argv[1]; + this.args = Minimist(process.argv.slice(2)) + this.node = process.argv[0] + this.script = process.argv[1] } /** @@ -24,11 +24,11 @@ class Input { */ get(name, defaultValue) { if (this.has(name)) { - return this.args[name]; + return this.args[name] } if (defaultValue !== undefined) { - return defaultValue; + return defaultValue } return null; @@ -42,7 +42,7 @@ class Input { * @return boolean */ has(name) { - return this.args.hasOwnProperty(name); + return this.args.hasOwnProperty(name) } /** @@ -51,7 +51,7 @@ class Input { * @return boolean */ empty() { - return Object.keys(this.args).length === 1; + return Object.keys(this.args).length === 1 } } diff --git a/src/console/output.js b/src/console/output.js index 20e94ea..f03d121 100644 --- a/src/console/output.js +++ b/src/console/output.js @@ -11,15 +11,15 @@ class Output { data, function(key, value) { if (value === undefined) { - return null; + return null } - return value; + return value }, pretty ? 2 : null ); - return this.write(data); + return this.write(data) } /** diff --git a/src/index.js b/src/index.js index 8d9a47b..1344208 100644 --- a/src/index.js +++ b/src/index.js @@ -35,9 +35,9 @@ Optional parameters HTTP --method [METHOD] HTTP Method - --accept-http-error Accepts all status code (like 404) + --accept-http-error Accepts all status codes (like 404) - --verbose, -v Show message of error + --verbose, -v Show message of error ` if (input.has('help')) {