GT2/GT2-iOS/node_modules/optionator/package.json

111 lines
17 KiB
JSON

{
"_args": [
[
{
"raw": "optionator@^0.8.1",
"scope": null,
"escapedName": "optionator",
"name": "optionator",
"rawSpec": "^0.8.1",
"spec": ">=0.8.1 <0.9.0",
"type": "range"
},
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/escodegen"
]
],
"_from": "optionator@>=0.8.1 <0.9.0",
"_id": "optionator@0.8.2",
"_inCache": true,
"_location": "/optionator",
"_nodeVersion": "6.6.0",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/optionator-0.8.2.tgz_1474487142656_0.7901301246602088"
},
"_npmUser": {
"name": "gkz",
"email": "z@georgezahariev.com"
},
"_npmVersion": "3.9.0",
"_phantomChildren": {},
"_requested": {
"raw": "optionator@^0.8.1",
"scope": null,
"escapedName": "optionator",
"name": "optionator",
"rawSpec": "^0.8.1",
"spec": ">=0.8.1 <0.9.0",
"type": "range"
},
"_requiredBy": [
"/escodegen"
],
"_resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
"_shasum": "364c5e409d3f4d6301d6c0b4c05bba50180aeb64",
"_shrinkwrap": null,
"_spec": "optionator@^0.8.1",
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/escodegen",
"author": {
"name": "George Zahariev",
"email": "z@georgezahariev.com"
},
"bugs": {
"url": "https://github.com/gkz/optionator/issues"
},
"dependencies": {
"deep-is": "~0.1.3",
"fast-levenshtein": "~2.0.4",
"levn": "~0.3.0",
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2",
"wordwrap": "~1.0.0"
},
"description": "option parsing and help generation",
"devDependencies": {
"istanbul": "~0.4.1",
"livescript": "~1.5.0",
"mocha": "~3.0.2"
},
"directories": {},
"dist": {
"shasum": "364c5e409d3f4d6301d6c0b4c05bba50180aeb64",
"tarball": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz"
},
"engines": {
"node": ">= 0.8.0"
},
"files": [
"lib",
"README.md",
"LICENSE"
],
"gitHead": "191de235d5afa47ebb655fc0efbc2b616263d81b",
"homepage": "https://github.com/gkz/optionator",
"keywords": [
"options",
"flags",
"option parsing",
"cli"
],
"license": "MIT",
"main": "./lib/",
"maintainers": [
{
"name": "gkz",
"email": "z@georgezahariev.com"
}
],
"name": "optionator",
"optionalDependencies": {},
"readme": "# Optionator\n<a name=\"optionator\" />\n\nOptionator is a JavaScript option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator).\n\nFor an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo).\n\n[About](#about) &middot; [Usage](#usage) &middot; [Settings Format](#settings-format) &middot; [Argument Format](#argument-format)\n\n## Why?\nThe problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not.\nWith Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant).\nIf you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application.\n\n $ cmd --halp\n Invalid option '--halp' - perhaps you meant '--help'?\n\n $ cmd --count str\n Invalid value for option 'count' - expected type Int, received value: str.\n\nOther helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier.\n\n## About\nOptionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types.\n\nMIT license. Version 0.8.2\n\n npm install optionator\n\nFor updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev).\n\n## Usage\n`require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `parseArgv`, `generateHelp`, and `generateHelpForOption`, which are all functions.\n\n```js\nvar optionator = require('optionator')({\n prepend: 'Usage: cmd [options]',\n append: 'Version 1.0.0',\n options: [{\n option: 'help',\n alias: 'h',\n type: 'Boolean',\n description: 'displays help'\n }, {\n option: 'count',\n alias: 'c',\n type: 'Int',\n description: 'number of things',\n example: 'cmd --count 2'\n }]\n});\n\nvar options = optionator.parseArgv(process.argv);\nif (options.help) {\n console.log(optionator.generateHelp());\n}\n...\n```\n\n### parse(input, parseOptions)\n`parse` processes the `input` according to your settings, and returns an object with the results.\n\n##### arguments\n* input - `[String] | Object | String` - the input you wish to parse\n* parseOptions - `{slice: Int}` - all options optional\n - `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`)\n\n##### returns\n`Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key.\n\n##### example\n```js\nparse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']}\nparse('--count 2 positional'); // {count: 2, _: ['positional']}\nparse({count: 2, _:['positional']}); // {count: 2, _: ['positional']}\n```\n\n### parseArgv(input)\n`parseArgv` works exactly like `parse`, but only for array input and it slices off the first two elements.\n\n##### arguments\n* input - `[String]` - the input you wish to parse\n\n##### returns\nSee \"returns\" section in \"parse\"\n\n##### example\n```js\nparseArgv(process.argv);\n```\n\n### generateHelp(helpOptions)\n`generateHelp` produces help text based on your settings.\n\n##### arguments\n* helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional\n - `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false`\n - `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2`\n\n##### returns\n`String` - the generated help text\n\n##### example\n```js\ngenerateHelp(); /*\n\"Usage: cmd [options] positional\n\n -h, --help displays help\n -c, --count Int number of things\n\nVersion 1.0.0\n\"*/\n```\n\n### generateHelpForOption(optionName)\n`generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed, and if a `longDescription` was specified, it will display that instead of the `description`.\n\n##### arguments\n* optionName - `String` - the name of the option to display\n\n##### returns\n`String` - the generated help text for the option\n\n##### example\n```js\ngenerateHelpForOption('count'); /*\n\"-c, --count Int\ndescription: number of things\nexample: cmd --count 2\n\"*/\n```\n\n## Settings Format\nWhen your `require('optionator')`, you get a function that takes in a settings object. This object has the type:\n\n {\n prepend: String,\n append: String,\n options: [{heading: String} | {\n option: String,\n alias: [String] | String,\n type: String,\n enum: [String],\n default: String,\n restPositional: Boolean,\n required: Boolean,\n overrideRequired: Boolean,\n dependsOn: [String] | String,\n concatRepeatedArrays: Boolean | (Boolean, Object),\n mergeRepeatedObjects: Boolean,\n description: String,\n longDescription: String,\n example: [String] | String\n }],\n helpStyle: {\n aliasSeparator: String,\n typeSeparator: String,\n descriptionSeparator: String,\n initialIndent: Int,\n secondaryIndent: Int,\n maxPadFactor: Number\n },\n mutuallyExclusive: [[String | [String]]],\n concatRepeatedArrays: Boolean | (Boolean, Object), // deprecated, set in defaults object\n mergeRepeatedObjects: Boolean, // deprecated, set in defaults object\n positionalAnywhere: Boolean,\n typeAliases: Object,\n defaults: Object\n }\n\nAll of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array.\n\n### Top Level Properties\n* `prepend` is an optional string to be placed before the options in the help text\n* `append` is an optional string to be placed after the options in the help text\n* `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified\n* `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text\n* `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present\n* `concatRepeatedArrays` see description under the \"Option Properties\" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property\n* `mergeRepeatedObjects` see description under the \"Option Properties\" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property\n* `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack`\n* `typeAliases` is an optional object, it allows you to set aliases for types, eg. `{Path: 'String'}` would allow you to use the type `Path` as an alias for the type `String`\n* `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: \"String\" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property\n\n#### Heading Properties\n* `heading` a required string, the name of the heading\n\n#### Option Properties\n* `option` the required name of the option - use dash-case, without the leading dashes\n* `alias` is an optional string or array of strings which specify any aliases for the option\n* `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it\n* `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type`\n* `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type`\n* `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument\n* `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined\n* `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags\n* `concatRepeatedArrays` is an optional boolean or tuple with boolean and options object (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']`\n\n You can supply an options object by giving the following value: `[true, options]`. The one currently supported option is `oneValuePerFlag`, this only allows one array value per flag. This is useful if your potential values contain a comma.\n* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}`\n* `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set\n* `description` is an optional string, which will be displayed next to the option in the help text\n* `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used\n* `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used\n\n#### Help Style Properties\n* `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,'\n* `typeSeparator` is an optional string, separates the type from the names - default: ' '\n* `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: ' '\n* `initialIndent` is an optional int - the amount of indent for options - default: 2\n* `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4\n* `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5\n\n## Argument Format\nAt the highest level there are two types of arguments: named, and positional.\n\nName arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`).\n\nThere are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value.\n\nFor more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages.\n\nYou can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`.\n\nPositional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`.\n\nEverything after an `--` is positional, even if it looks like a named argument.\n\nYou may optionally use `=` to separate option names from values, for example: `--count=2`.\n\nIf you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`.\n\nIf duplicate named arguments are present, the last one will be taken.\n\n## Technical About\n`optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library.\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/gkz/optionator.git"
},
"scripts": {
"test": "make test"
},
"version": "0.8.2"
}