optimist/000755 001751 000177 0000000000 14522377323014431 5ustar00runner000000 000000 1452237732314522377323optimist/LICENSE000644 001751 000177 0000002165 14522377323015442 0ustar00runner000000 000000 1452237732314522377323 MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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 optimist/README.md000644 001751 000177 0000001034 14522377323015701 0ustar00runner000000 000000 1452242622414522377323# Installation > `npm install --save @types/optimist` # Summary This package contains type definitions for optimist (https://github.com/substack/node-optimist). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/optimist. ### Additional Details * Last updated: Tue, 07 Nov 2023 09:09:39 GMT * Dependencies: none # Credits These definitions were written by [Carlos Ballesteros Velasco](https://github.com/soywiz), and [Christopher Brown](https://github.com/chbrown). optimist/index.d.ts000644 001751 000177 0000007201 14522377323016332 0ustar00runner000000 000000 1452237732314522377323declare namespace optimist { interface Opt { alias?: string | string[] | undefined; default?: any; demand?: string | number | string[] | undefined; describe?: string | undefined; type?: string | undefined; } interface Parser { /** Implicitly use process.argv array to construct the argv object */ argv: any; /** Pass in the process.argv yourself */ (args: string[]): any; /** Use .parse() to do the same thing as treating optimist as a function */ parse(args: string[]): any; // The types below follow the order and documentation of https://github.com/substack/node-optimist /** Set key names as equivalent such that updates to a key will propagate to aliases and vice-versa. */ alias(key: string, alias: string | string[]): Parser; /** Take an object that maps keys to aliases. */ alias(aliases: { [index: string]: string | string[] }): Parser; /** Set argv[key] to value if no option was specified on process.argv */ default(key: string, value: any): Parser; /** Take an object that maps keys to default values */ default(defaults: { [index: string]: any }): Parser; /** Show the usage information and exit if key wasn't specified in process.argv */ demand(key: string): Parser; /** Demand at least as many non-option arguments, which show up in argv._ */ demand(key: number): Parser; /** Demand each element in key */ demand(key: string[]): Parser; /** Describe a key for the generated usage information */ describe(key: string, desc: string): Parser; /** Take an object that maps keys to descriptions */ describe(descriptions: { [index: string]: string }): Parser; /** Instead of chaining together, e.g. optimist.alias().demand().default()..., you can specify keys in opt for each of the chainable methods. */ options(key: string, opt: Opt): Parser; /** Take an object that maps keys to opt parameters */ options(options: { [index: string]: Opt }): Parser; /** Set a usage message to show which commands to use. Inside message, the string $0 will get interpolated to the current script name or node command for the present script similar to how $0 works in bash or perl. */ usage(message: string): Parser; /** Check that certain conditions are met in the provided arguments. If fn throws or returns false, show the thrown error, usage information, and exit. */ check(fn: (argv: any) => any): Parser; /** Interpret key as a boolean. If a non-flag option follows key in process.argv, that string won't get set as the value of key. If key never shows up as a flag in process.arguments, argv[key] will be false. */ boolean(key: string): Parser; /** Interpret all the elements as booleans. */ boolean(key: string[]): Parser; /** Tell the parser logic not to interpret key as a number or boolean. This can be useful if you need to preserve leading zeros in an input. */ string(key: string): Parser; /** Interpret all the elements as strings */ string(key: string[]): Parser; /** Format usage output to wrap at columns many columns. */ wrap(columns: number): Parser; /** Return the generated usage string. */ help(): string; /** Print the usage data using fn for printing (defaults to console.error). */ showHelp(fn?: (message: string) => void): void; } } declare var optimist: optimist.Parser; export = optimist; optimist/package.json000644 001751 000177 0000001670 14522377323016716 0ustar00runner000000 000000 1452242622414522377323{ "name": "@types/optimist", "version": "0.0.33", "description": "TypeScript definitions for optimist", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/optimist", "license": "MIT", "contributors": [ { "name": "Carlos Ballesteros Velasco", "githubUsername": "soywiz", "url": "https://github.com/soywiz" }, { "name": "Christopher Brown", "githubUsername": "chbrown", "url": "https://github.com/chbrown" } ], "main": "", "types": "index.d.ts", "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", "directory": "types/optimist" }, "scripts": {}, "dependencies": {}, "typesPublisherContentHash": "1dd252acd70a9c73cd64edda97d2c9a766f8ea1204aecec3a1ba450a17a9e85a", "typeScriptVersion": "4.5" }