From 71b65619a75216619609d726ceba154ae2cd2f9b Mon Sep 17 00:00:00 2001 From: David Ralph Date: Mon, 15 Apr 2019 08:56:22 +0100 Subject: [PATCH] Improvements --- .travis.yml | 2 +- LICENSE | 3 +-- README.md | 11 ++++------- larg.d.ts | 1 - larg.js | 2 +- package.json | 8 ++++---- test.js | 2 +- 7 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9816a88..751c4cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,4 @@ language: node_js sudo: false node_js: - '8' - - '10' + - '10' \ No newline at end of file diff --git a/LICENSE b/LICENSE index bcd4705..07a09c9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - The MIT License (MIT) Copyright (c) 2019-present Wessel "wesselgame" T @@ -19,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index e7b182b..383f077 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # larg > A lightweight Node.js argument parser which can be used in various ways. -> [GitHub](https://www.github.com/PassTheWessel/larg) **|** [NPM](https://www.npmjs.com/package/larg) +> [GitHub](https://github.com/PassTheWessel/larg) **|** [NPM](https://npmjs.com/package/larg) ## Installing ```sh @@ -12,8 +12,8 @@ $ npm i larg # Install w/ NPM ## Usage ##### Code ```js -const argv = require( 'larg' )( process.argv.slice( 2 ) ); -console.log( argv ); +const argv = require('larg')(process.argv.slice(2)); +console.log(argv); ``` ##### Result ```sh @@ -24,7 +24,4 @@ $ node test.js -x 3 -y 4 -ab --beep=boop foo bar a: true, b: true, beep: 'boop' } -``` - -### Why should I use larg? -Larg is very lightweight (3.45kb total, 569b minified in **dist/larg.min.js**) comparing to other packages such as optimist and minimist. +``` \ No newline at end of file diff --git a/larg.d.ts b/larg.d.ts index 1aa4778..93bf598 100644 --- a/larg.d.ts +++ b/larg.d.ts @@ -1,4 +1,3 @@ // Typings Componenet for package: larg - declare function larg(args?: any[]): any; export = larg; \ No newline at end of file diff --git a/larg.js b/larg.js index 851745b..190b7dc 100644 --- a/larg.js +++ b/larg.js @@ -2,7 +2,7 @@ * Parse arguments of an array * @param {Array} args - The arguments to parse * @returns {Object} - The parsed arguments - */ +*/ module.exports = (args) => { let p = {}; let l = []; diff --git a/package.json b/package.json index 5dc1e7c..ee0b8ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "larg", - "version": "0.0.3", + "version": "0.0.4", "description": "👾 A very lightweight Node.js argument parser", "author": "Wessel \"wesselgame\" T ", "license": "MIT", @@ -10,13 +10,13 @@ "LICENSE" ], "bugs": { - "url": "https://www.github.com/PassTheWessel/larg/issues" + "url": "https://github.com/PassTheWessel/larg/issues" }, - "homepage": "https://www.github.com/PassTheWessel/larg#readme", + "homepage": "https://github.com/PassTheWessel/larg#readme", "types": "index.d.ts", "repository": { "type": "git", - "url": "https://www.github.com/PassTheWessel/larg" + "url": "https://github.com/PassTheWessel/larg" }, "scripts": { "test": "node test.js" diff --git a/test.js b/test.js index 01fe69b..f3f4414 100644 --- a/test.js +++ b/test.js @@ -1 +1 @@ -console.log( require( './' )( process.argv.slice( 2 ) ) ) \ No newline at end of file +console.log(require('./')(process.argv.slice(2))); \ No newline at end of file