{"id":22092254,"url":"https://github.com/pirxpilot/optymista","last_synced_at":"2025-07-04T07:06:56.064Z","repository":{"id":149702093,"uuid":"621963364","full_name":"pirxpilot/optymista","owner":"pirxpilot","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-13T13:30:16.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-26T21:52:00.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-31T19:21:43.000Z","updated_at":"2023-03-31T19:22:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"64d04c53-c745-4109-8306-55cfc05a96b8","html_url":"https://github.com/pirxpilot/optymista","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pirxpilot/optymista","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Foptymista","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Foptymista/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Foptymista/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Foptymista/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/optymista/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Foptymista/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262863205,"owners_count":23376432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T03:08:53.391Z","updated_at":"2025-07-04T07:06:56.018Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][build-image]][build-url]\n\n# optymista\n\nArgv parser. Like [`optimist`][optimist] but using node's [`util.parseArgs`][util-parse-args].\n\n## Install\n\n```sh\n$ npm install --save optymista\n```\n\n## Usage\n\n```js\nconst { argv } = require('optymista')\n  .usage('noble-gas [options]')\n  .boolean('verbose').describe('says everything')\n  .describe('name', 'name of the gas').short('N').default('argon');\n\nif (argv.verbose) {\n  console.log('starting');\n}\n\nconsole.log('name:', argv.name);\n```\n\n## API\n\nFluid API corresponding to [`util.parseArgs`][util-parse-args] options:\n\n- `boolean()`, `string()` - set option type to `boolean` or `string` - `boolean` is the default\n- `default()` - sets option default value\n- `multiple()` - option can be provided multiple times and all values will be collected in an array\n- `short()` - provides a one letter alternative to longer POSIX style option\n- `option()` - can be used to directly provide one or more option properties\n- `version()` - implements `--version,-V` support - if no version is passed `optymista` will try to read\n  one from the `package.json` file\n\nHelp is automatically generated based on the information provided through `usage` and `descibe`\n\n- `usage()` - one or more strings that will form help text header\n- `describe()` - option description\n- `showHelp()` - display the help text on standard output \n\n`-h|--help` is automatically added to the list of options and treated as a request to show help text.\n\nIn case of any parsing errors help and the message associated with thrown exception is displayed.\n\nMethods can be chained with option name used only in the first method:\n\n```js\nstring('width').short('w').string('height').short('h')\n```\n\n## License\n\nMIT © [Damian Krzeminski](https://pirxpilot.me)\n\n[npm-image]: https://img.shields.io/npm/v/optymista\n[npm-url]: https://npmjs.org/package/optymista\n\n[build-url]: https://github.com/pirxpilot/optymista/actions/workflows/check.yaml\n[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/optymista/check.yaml?branch=main\n\n[util-parse-args]: https://nodejs.org/api/util.html#utilparseargsconfig\n[optimist]: https://npmjs.org/package/optimist\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Foptymista","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Foptymista","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Foptymista/lists"}