https://github.com/juliandavidmr/argvd
Argv, describe all parameters of a function.
https://github.com/juliandavidmr/argvd
arguments cli javascript methods npm-package
Last synced: about 1 year ago
JSON representation
Argv, describe all parameters of a function.
- Host: GitHub
- URL: https://github.com/juliandavidmr/argvd
- Owner: juliandavidmr
- License: mit
- Created: 2016-07-25T21:58:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-02T05:40:34.000Z (almost 9 years ago)
- Last Synced: 2025-02-06T01:39:04.742Z (about 1 year ago)
- Topics: arguments, cli, javascript, methods, npm-package
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
# Argvd
Argvd, describe all parameters of a function.
## Installation ##
```bash
$> npm install argvd --save
```
## Examples ##
```js
var argvd = require('argvd');
function anyfunction(a, b, array, param4, param5) {
var result = argvd.desc(arguments); //List
console.log("Arguments described:\n", JSON.stringify(result, null, 2));
console.log("hasNumbers?: ", argvd.hasNumbers(arguments));
console.log("hasString?: ", argvd.hasString(arguments));
console.log("hasArray?: ", argvd.hasArray(arguments));
console.log("hasFunction?: ", argvd.hasFunction(arguments));
console.log("hasObject?: ", argvd.hasObject(arguments));
console.log("Count: ", argvd.count(arguments));
}
var arr = [1, 2, 3, 4];
anyfunction(2, 4, arr, "Hello", function(){}, Object());
/*
Arguments described:
[
{
"key": "0",
"value": 2,
"type": "number"
},
{
"key": "1",
"value": 4,
"type": "number"
},
{
"key": "2",
"value": [
1,
2,
3,
4
],
"type": "array"
},
{
"key": "3",
"value": "Hello",
"type": "string"
},
{
"key": "4",
"type": "function"
},
{
"key": "5",
"value": {},
"type": "object"
}
]
hasNumbers?: true
hasString?: true
hasArray?: true
hasFunction?: true
hasObject?: true
Count: 6
*/
```