mirror of
https://github.com/Wessel/larg.git
synced 2026-06-05 23:15:43 +02:00
Improvements
This commit is contained in:
@@ -2,4 +2,4 @@ language: node_js
|
|||||||
sudo: false
|
sudo: false
|
||||||
node_js:
|
node_js:
|
||||||
- '8'
|
- '8'
|
||||||
- '10'
|
- '10'
|
||||||
3
LICENSE
3
LICENSE
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2019-present Wessel "wesselgame" T
|
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
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
11
README.md
11
README.md
@@ -1,7 +1,7 @@
|
|||||||
# larg
|
# larg
|
||||||
> A lightweight Node.js argument parser which can be used in various ways.
|
> 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
|
## Installing
|
||||||
```sh
|
```sh
|
||||||
@@ -12,8 +12,8 @@ $ npm i larg # Install w/ NPM
|
|||||||
## Usage
|
## Usage
|
||||||
##### Code
|
##### Code
|
||||||
```js
|
```js
|
||||||
const argv = require( 'larg' )( process.argv.slice( 2 ) );
|
const argv = require('larg')(process.argv.slice(2));
|
||||||
console.log( argv );
|
console.log(argv);
|
||||||
```
|
```
|
||||||
##### Result
|
##### Result
|
||||||
```sh
|
```sh
|
||||||
@@ -24,7 +24,4 @@ $ node test.js -x 3 -y 4 -ab --beep=boop foo bar
|
|||||||
a: true,
|
a: true,
|
||||||
b: true,
|
b: true,
|
||||||
beep: 'boop' }
|
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
1
larg.d.ts
vendored
@@ -1,4 +1,3 @@
|
|||||||
// Typings Componenet for package: larg
|
// Typings Componenet for package: larg
|
||||||
|
|
||||||
declare function larg(args?: any[]): any;
|
declare function larg(args?: any[]): any;
|
||||||
export = larg;
|
export = larg;
|
||||||
2
larg.js
2
larg.js
@@ -2,7 +2,7 @@
|
|||||||
* Parse arguments of an array
|
* Parse arguments of an array
|
||||||
* @param {Array} args - The arguments to parse
|
* @param {Array} args - The arguments to parse
|
||||||
* @returns {Object} - The parsed arguments
|
* @returns {Object} - The parsed arguments
|
||||||
*/
|
*/
|
||||||
module.exports = (args) => {
|
module.exports = (args) => {
|
||||||
let p = {};
|
let p = {};
|
||||||
let l = [];
|
let l = [];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "larg",
|
"name": "larg",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"description": "👾 A very lightweight Node.js argument parser",
|
"description": "👾 A very lightweight Node.js argument parser",
|
||||||
"author": "Wessel \"wesselgame\" T <discord@go2it.eu>",
|
"author": "Wessel \"wesselgame\" T <discord@go2it.eu>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -10,13 +10,13 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"bugs": {
|
"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",
|
"types": "index.d.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://www.github.com/PassTheWessel/larg"
|
"url": "https://github.com/PassTheWessel/larg"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node test.js"
|
"test": "node test.js"
|
||||||
|
|||||||
Reference in New Issue
Block a user