Improvements

This commit is contained in:
David Ralph
2019-04-15 08:56:22 +01:00
parent e3ff5bc0b5
commit 71b65619a7
7 changed files with 12 additions and 17 deletions

View File

@@ -2,4 +2,4 @@ language: node_js
sudo: false
node_js:
- '8'
- '10'
- '10'

View File

@@ -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.

View File

@@ -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.
```

1
larg.d.ts vendored
View File

@@ -1,4 +1,3 @@
// Typings Componenet for package: larg
declare function larg(args?: any[]): any;
export = larg;

View File

@@ -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 = [];

View File

@@ -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 <discord@go2it.eu>",
"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"

View File

@@ -1 +1 @@
console.log( require( './' )( process.argv.slice( 2 ) ) )
console.log(require('./')(process.argv.slice(2)));