{"id":13447754,"url":"https://github.com/mccormicka/string-argv","last_synced_at":"2025-03-22T01:31:15.021Z","repository":{"id":13811471,"uuid":"16507737","full_name":"mccormicka/string-argv","owner":"mccormicka","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-01T16:52:45.000Z","size":38,"stargazers_count":58,"open_issues_count":3,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T19:08:27.339Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mccormicka.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2014-02-04T09:44:25.000Z","updated_at":"2024-11-22T03:46:02.000Z","dependencies_parsed_at":"2024-06-18T13:33:24.522Z","dependency_job_id":"14d50ab7-571f-423e-a4d9-b3b8a86144b7","html_url":"https://github.com/mccormicka/string-argv","commit_stats":{"total_commits":26,"total_committers":9,"mean_commits":2.888888888888889,"dds":"0.46153846153846156","last_synced_commit":"d2bfe61de1681ea5e0507441c7054d467c86cd94"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccormicka%2Fstring-argv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccormicka%2Fstring-argv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccormicka%2Fstring-argv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccormicka%2Fstring-argv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mccormicka","download_url":"https://codeload.github.com/mccormicka/string-argv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244893433,"owners_count":20527590,"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-07-31T05:01:26.089Z","updated_at":"2025-03-22T01:31:14.686Z","avatar_url":"https://github.com/mccormicka.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# What is it?\n`string-argv` parses a string into an argument array to mimic `process.argv`.\nThis is useful when testing Command Line Utilities that you want to pass arguments to and is the opposite of what the other argv utilities do.\n\n# Installation\n\n```\nnpm install string-argv --save\n```\n\n# Usage\n\n```ts\n// Typescript\nimport stringArgv from 'string-argv';\n\nconst args = stringArgv(\n  '-testing test -valid=true --quotes \"test quotes\" \"nested \\'quotes\\'\" --key=\"some value\" --title=\"Peter\\'s Friends\"',\n  'node',\n  'testing.js'\n);\n\nconsole.log(args);\n```\n\n```js\n// Javascript\nvar { parseArgsStringToArgv } = require('string-argv');\n\nvar args = parseArgsStringToArgv(\n    '-testing test -valid=true --quotes \"test quotes\" \"nested \\'quotes\\'\" --key=\"some value\" --title=\"Peter\\'s Friends\"',\n    'node',\n    'testing.js'\n);\n\nconsole.log(args);\n/** output\n[ 'node',\n  'testing.js',\n  '-testing',\n  'test',\n  '-valid=true',\n  '--quotes',\n  'test quotes',\n  'nested \\'quotes\\'',\n  '--key=\"some value\"',\n  '--title=\"Peter\\'s Friends\"' ]\n  **/\n```\n\n## params\n\n__required__: __arguments__ String: arguments that you would normally pass to the command line.\n\n__optional__: __environment__ String: Adds to the environment position in the argv array. If ommitted then there is no need to call argv.split(2) to remove the environment/file values. However if your cli.parse method expects a valid argv value then you should include this value.\n\n__optional__: __file__ String: file that called the arguments. If omitted then there is no need to call argv.split(2) to remove the environment/file values. However if your cli.parse method expects a valid argv value then you should include this value.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccormicka%2Fstring-argv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmccormicka%2Fstring-argv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccormicka%2Fstring-argv/lists"}