{"id":15365953,"url":"https://github.com/andywer/nanomist","last_synced_at":"2025-10-11T13:23:02.009Z","repository":{"id":66057865,"uuid":"97759472","full_name":"andywer/nanomist","owner":"andywer","description":"A maintained and even tinier version of minimist","archived":false,"fork":false,"pushed_at":"2017-07-19T20:44:25.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T19:22:59.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.com/nanomist","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andywer.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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,"publiccode":null,"codemeta":null}},"created_at":"2017-07-19T20:43:25.000Z","updated_at":"2018-11-15T17:34:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"d841bc94-b524-4614-93b2-3554dbdaee86","html_url":"https://github.com/andywer/nanomist","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/andywer/nanomist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fnanomist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fnanomist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fnanomist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fnanomist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andywer","download_url":"https://codeload.github.com/andywer/nanomist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fnanomist/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264713033,"owners_count":23652705,"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-10-01T13:16:47.912Z","updated_at":"2025-10-11T13:22:56.961Z","avatar_url":"https://github.com/andywer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanomist\n\nThis package lets you parse command line arguments inside CLIs. It's a fork of [minimist](https://github.com/substack/minimist) (which is unmaintained and bigger on disk - in turn, we decided to create our own fork).\n\n## Usage\n\nFirst, install it:\n\n```bash\nnpm install --save nanomist\n```\n\nThen you can start using it:\n\n``` js\nconst flags = require('minimist')(process.argv.slice(2))\nconsole.dir(flags)\n```\n\nHere's what the result will look like:\n\n```\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\nAnd another one with more flags:\n\n```\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{ _: [ 'foo', 'bar', 'baz' ],\n  x: 3,\n  y: 4,\n  n: 5,\n  a: true,\n  b: true,\n  c: true,\n  beep: 'boop' }\n```\n\n## API\n\n``` js\nconst parseArgs = require('minimist')\n```\n\n## var argv = parseArgs(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a boolean, string or array of strings to always treat as\nbooleans. if `true` will treat all double hyphenated arguments without equal signs\nas boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`)\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n* `opts.stopEarly` - when true, populate `argv._` with everything after the\nfirst non-option\n* `opts['--']` - when true, populate `argv._` with everything before the `--`\nand `argv['--']` with everything after the `--`. Here's an example:\n\n  ```\n  \u003e require('./')('one two three -- four five --six'.split(' '), { '--': true })\n  { _: [ 'one', 'two', 'three' ],\n    '--': [ 'four', 'five', '--six' ] }\n  ```\n\n  Note that with `opts['--']` set, parsing for arguments still stops after the\n  `--`.\n\n* `opts.unknown` - a function which is invoked with a command line parameter not\ndefined in the `opts` configuration object. If the function returns `false`, the\nunknown option is not added to `argv`.\n\n## Authors\n\n- James Halliday ([@substack](https://twitter.com/substack))\n- Leo Lamprecht ([@notquiteleo](https://twitter.com/notquiteleo)) - [▲ZEIT](https://zeit.co)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywer%2Fnanomist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandywer%2Fnanomist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywer%2Fnanomist/lists"}