{"name":"string-argv","description":"string-argv parses a string into an argument array to mimic process.argv. This is useful when testing Command Line Utilities that you want to pass arguments to.","version":"0.3.2","contributors":[{"name":"Michael Ferris","email":"mike.ferri@hotmail.com"}],"author":{"name":"Anthony McCormick","email":"anthony.mccormick@gmail.com"},"license":"MIT","keywords":["argv"],"scripts":{"build":"tsc -p . & tsc -p tsconfig.commonjs.json","prepublishOnly":"npm test","test":"npm run build & jasmine --config=test/config.json"},"type":"module","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./commonjs/index.js"}},"main":"./commonjs/index.js","module":"./index.js","types":"index.d.ts","engines":{"node":">=0.6.19"},"bugs":{"url":"https://github.com/mccormicka/string-argv/issues"},"repository":{"type":"git","url":"git+https://github.com/mccormicka/string-argv.git"},"homepage":"https://github.com/mccormicka/string-argv","devDependencies":{"jasmine":"^4.4.0","typescript":"^5.0.4"},"gitHead":"de7ecea79c0bbb9f5f81437b6fb4ba3c56c6b3ff","_id":"string-argv@0.3.2","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==","shasum":"2b6d0ef24b656274d957d54e0a4bbf6153dc02b6","tarball":"http://registry-npm.ywwl.com/string-argv/download/string-argv-0.3.2.tgz","fileCount":8,"unpackedSize":7796,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXZKVhA4DC9+Yk0L+ecM3vPQSgoHitfOFQ/fyEo4t//gIgCn7zPyEcZj3NFdfJXj9Q1zTmUqBI8HF0qW3uRea29rw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkT+5oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpq6A/+N1AayjNlwzv88SRNjqtnB36+5QO8f0OX8JOwKuC/u5oy5bo9\r\nihFQJ/Keyk2k1YS+2EmCFwc4KJdVa2y2nx33mtP2Ii9+ioASrxuh0E8jcgYR\r\nqq6wA7/7Cw31vcRql1vgIe9S0XIeRDa6eTJWNpQ6JEAkLB5RP7i8x2enN3nd\r\nW8jlqrPC/YcvzcZlA2rkywWCIrzXyxgqwl7Ev65NBU4JTo1e7Uuqh/Kj+XjT\r\nZ7P8ccopj4eanePyvQFI13N+VTZ0elH+vuxrzXAex3imrc6BPi0EnAmocvHF\r\nUzQNo2ySn2pzspHYS0hYO0CLMHavG7MFZcGaGiuUJvs0eTwt46QfHlG/Bt+y\r\n47oV5FSsW5FVKmpnp95MZ+BEtvwHKhU0aF90HgCTH65S3eGpArTfIuJdnX8+\r\nMAOM0EYOnQT9U6aE41/1RDXX9iIPcOsQceC2+Tst9TM2Z1T5Ar2Or/2LN6D+\r\n+rnbb9746PB2cgGQ7z3l4WFGqw4JR4yVzNbG+3ZTO8bY+a7hx7uVZkcfIYgV\r\nlF1RMX8tZEcWLxBcnz6pptVqaDnFzW1j2SWH3zKLu3cg202Mur81pFTrK8ky\r\n7x/NhxJ/V5EATYez7CttiyESiW7SC517F0mG7KKMgx2JQB/w0oIaoNvd5W2U\r\nQUoNxuymAGF7TJgD/BMXYoETEDUQEqrYVGI=\r\n=eMV3\r\n-----END PGP SIGNATURE-----\r\n","size":2956,"noattachment":false,"key":"/string-argv/-/string-argv-0.3.2.tgz"},"_npmUser":{"name":"cellule","email":"mike.ferris@hotmail.com"},"directories":{},"maintainers":[{"name":"mccormicka","email":"anthony.mccormick@gmail.com"},{"name":"cellule","email":"mike.ferris@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-argv_0.3.2_1682959976315_0.8337933300667209"},"_hasShrinkwrap":false,"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","publish_time":1682959976485,"_cnpm_publish_time":1682959976485,"dist-tags":{"latest":"0.4.0"}}