1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-17 01:16:00 +00:00
This commit is contained in:
MatteZ02
2020-03-03 22:30:50 +02:00
parent edfcc6f474
commit 30022c7634
11800 changed files with 1984416 additions and 1 deletions

1
node_modules/optjs/.npmignore generated vendored Normal file
View File

@ -0,0 +1 @@
opt.png

44
node_modules/optjs/README.md generated vendored Normal file
View File

@ -0,0 +1,44 @@
![opt.js](https://raw.github.com/dcodeIO/opt.js/master/opt.png)
======
Probably the sole command line option parser you'll ever need to <del>`npm install optjs`</del> Ctrl+C, Ctrl+V. Proof:
```js
function opt(argv) {
var opt={},arg,p;argv=Array.prototype.slice.call(argv||process.argv);for(var i=2;i<argv.length;i++)if(argv[i].charAt(0)=='-')
((p=(arg=(""+argv.splice(i--,1)).replace(/^[\-]+/,'')).indexOf("="))>0?opt[arg.substring(0,p)]=arg.substring(p+1):opt[arg]=true);
return {'node':argv[0],'script':argv[1],'argv':argv.slice(2),'opt':opt};
}
```
Usage
-----
```js
var opt = require("optjs")();
console.log(opt.node); // Path to node executable
console.log(opt.script); // Path to the current script
console.log(opt.opt); // Command line options as a hash
console.log(opt.argv); // Remaining non-option arguments
```
Example
-------
`node somescript.js foo -a=1 -b --c="hello world" bar ----d`
```js
// Result
opt.node == "/path/to/node[.exe]"
opt.script == "/path/to/somescript.js"
opt.opt == { a: 1, b: true, c: "hello world", d: true }
opt.argv == ["foo", "bar"]
```
Full-featured test suite
------------------------
```js
#!/usr/bin/env node
console.log(require("./opt.js")());
```
License
-------
MIT

8
node_modules/optjs/opt.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
module.exports = (function() {
function opt(argv) {
var opt={},arg,p;argv=Array.prototype.slice.call(argv||process.argv);for(var i=2;i<argv.length;i++)if(argv[i].charAt(0)=='-')
((p=(arg=(""+argv.splice(i--,1)).replace(/^[\-]+/,'')).indexOf("="))>0?opt[arg.substring(0,p)]=arg.substring(p+1):opt[arg]=true);
return {'node':argv[0],'script':argv[1],'argv':argv.slice(2),'opt':opt};
}
return opt.opt = opt;
})();

47
node_modules/optjs/package.json generated vendored Normal file
View File

@ -0,0 +1,47 @@
{
"_args": [
[
"optjs@3.2.2",
"C:\\Users\\matia\\Musix"
]
],
"_from": "optjs@3.2.2",
"_id": "optjs@3.2.2",
"_inBundle": false,
"_integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=",
"_location": "/optjs",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "optjs@3.2.2",
"name": "optjs",
"escapedName": "optjs",
"rawSpec": "3.2.2",
"saveSpec": null,
"fetchSpec": "3.2.2"
},
"_requiredBy": [
"/ascli"
],
"_resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz",
"_spec": "3.2.2",
"_where": "C:\\Users\\matia\\Musix",
"author": {
"name": "Daniel Wirtz",
"email": "dcode@dcode.io"
},
"bugs": {
"url": "https://github.com/dcodeIO/opt.js/issues"
},
"description": "Probably the sole command line option parser you'll ever need to...",
"homepage": "https://github.com/dcodeIO/opt.js#readme",
"license": "MIT",
"main": "./opt.js",
"name": "optjs",
"repository": {
"type": "git",
"url": "git+https://github.com/dcodeIO/opt.js.git"
},
"version": "3.2.2"
}

2
node_modules/optjs/test.js generated vendored Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
console.log(require("./opt.js")());