{"_id":"@a-morphous/linear","_rev":"2-a0e628a962bcfd1c9e961eaac7638e49","name":"@a-morphous/linear","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@a-morphous/linear","version":"1.0.0","type":"module","description":"Single-line configuration parser.","main":"index.js","module":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","dependencies":{"json5":"^2.2.1","moo":"^0.5.2"},"gitHead":"37823b534bd6ea44d5efad4f16e6c1e929ad7c8c","_id":"@a-morphous/linear@1.0.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-EWxFc6OXs6sI9rrgk8WjxRtyRj7vaU73uoFwAYuKG+GACCjx8v5SDD2v7JetfIvMhK8AL3azB89GctNGIyksqw==","shasum":"dc2b3e5b3cf356c8893c660f8ea3c97512efc3c8","tarball":"https://registry.npmjs.org/@a-morphous/linear/-/linear-1.0.0.tgz","fileCount":4,"unpackedSize":9318,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCnL4aX8E4Daq79wUH9uydberQ9QsTI8Z0q3Ms9iTdvgIhAJI1pyg45nFRA0RqY0dcxUyQyyqrsodPmiDXt611Ll5K"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfu47ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmZg/+Iw2W6x5nGtVZhpK2VVyT88Tcj/HhoVJkP4mS1kaA5g9BS58D\r\n64agrIY0EUF5jlZo16U02+81jZlfZhK2QAzSG7DcyBxjEKh2TMgWlxZSCI/G\r\ndstuOVZ/qwJjuAdeDuaU6ulYiRqLVATEb/InJANBZwMAXqx3k1Dliyr1zJ7w\r\njcv7vVH60yqJ+8Suaw0U44AtUhfOCY/C/QN6onLCHYxSt9Ag57r3YfuCBMjj\r\nWIHbqDrcbOTVXl2h/BFbVLRgu9rVDl173IK+dtE1BtaQNus7suBEf2II22Ba\r\noLw/KCf/toohuyeLEQXHFFDgO4Y4bq3s7ztJN276yw/3xzfDVUJCL1hky7cN\r\nbidAiRgemVrsyPg6N7pSDD0MRsytAWgkrtHBZw1bxm0Lx+vpxC/jtGCuj9R3\r\nukjeF6gA+kHT0ABomzqf3BsZmHZeHHF06gFZmh3mPMu9jmTcfsged4hU4beB\r\nW/hbyrrfTl9NBF48f9TCoh3qdT6leTRkRNgLMEa8Y2bJQrdNvKlYwqOF4l6E\r\nHdAnJaFps0yXdSjHkmi1b+DikbfIVB/9yhKG2eKGqcM94B0hFj7hyKsHhpIb\r\nj1qxtNF69fV3cYmDApDK6GvLVVWhIyZcdn7Pcw7dJOJ6Mzahcu00YGFvbLC9\r\n/onCKYm0lrUMLDRqAV1p2tbfjSDwDHJgqs4=\r\n=WHgD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"},"directories":{},"maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/linear_1.0.0_1669262907237_0.5625427760248256"},"_hasShrinkwrap":false},"1.0.1":{"name":"@a-morphous/linear","version":"1.0.1","type":"module","description":"Single-line configuration parser.","main":"index.js","module":"index.js","keywords":[],"author":"","license":"ISC","dependencies":{"json5":"^2.2.1","moo":"^0.5.2"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","dryRun":"pnpm publish --dry-run","pub":"pnpm publish --access public"},"_id":"@a-morphous/linear@1.0.1","_integrity":"sha512-hsUADcZaht+o/gCdpcVegBpfguLm7n1Pc3KQ6kBlEuThbJmJFs3VKR8beqYvjYEggdHxsReel0CX1D65gLXvDg==","_resolved":"/private/var/folders/pd/2r2pf8ln2cv61g2b_k9fr5nc0000gn/T/5c1bc6cbe5c9ef3e77d57c9f63785949/a-morphous-linear-1.0.1.tgz","_from":"file:a-morphous-linear-1.0.1.tgz","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-hsUADcZaht+o/gCdpcVegBpfguLm7n1Pc3KQ6kBlEuThbJmJFs3VKR8beqYvjYEggdHxsReel0CX1D65gLXvDg==","shasum":"863404bac4a52080dc8c47b6829c6e13182623f2","tarball":"https://registry.npmjs.org/@a-morphous/linear/-/linear-1.0.1.tgz","fileCount":5,"unpackedSize":9568,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAmKhm+hTCpRhzsmCLzocV5fKTbetQlYh3UTo2eGI0y2AiAKlKa3z2s3ziTexzONIJ1CyQDcq1db3BrEGjLu/5i5Ug=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNYppACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEuBAAjqJdJkg61AikpgDDh9a+3XfNdBdRBFs8lhqw+y9Bvz8o2O5G\r\ns+Yj1xEvATUPQsnjOT/9pWP6po2/VsGhUBb69WrEBrHK99yMN3lIFEwdYF96\r\nBgjG9OwR2xLpYT6F33MJPEqKupWT+SGsVkPNEECRtxVIoUxfcD1eJnQE530O\r\nOAaJW21RMDL7H5yQsDExt99NQIc6xEqesNcJEi0z7Isgsia0BRJxkToCWD0v\r\nNkN+GKkcYKk7G1rAuj+i9MA5H+aS7ID8PvsGCLm/bHMDM6OeQGPvmJgOoJza\r\nH3QibhF/LR0aB9+UdXepzuTyG9Jnk1YJxsI0QlQDnE9FJI2WBUB73iMfig0q\r\nxRrp4ir1zjjqKvkNU3E2cRqZai8RAKUykJ8lF6zX/99QpylH3cbbCDiCdpVA\r\nVN5kNR6l39Sq9slNdzTm0ZjyXvGg1jp1tGs3KuSPzY96MK5YhNdV7dHUKitp\r\nCvJW96rk66VaN6lHwb4a+mARThxWtuj2mC84lI8sZJwrc84ys1PO/JzXrxgD\r\ndz2pRHQF2SPfUNAxsNQ7d7ktxppr2fWu8+GA2c7AEHPg5NKGgTSc88EGv4qU\r\ndwnYWskqLMvmpIem5FUGxIRoLony2Uqwr5c9IYoDfdUBrNts+wMll0WkSjjY\r\n1UkMiDjs2fJa1MSznYD8bTA/gQSL9aRMPJ0=\r\n=Avay\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"},"directories":{},"maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/linear_1.0.1_1681230440944_0.20583576758687583"},"_hasShrinkwrap":false},"1.0.2":{"name":"@a-morphous/linear","version":"1.0.2","type":"module","description":"Single-line configuration parser.","main":"index.js","module":"index.js","keywords":[],"author":"","license":"ISC","dependencies":{"json5":"^2.2.1","moo":"^0.5.2"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","dryRun":"pnpm publish --dry-run","pub":"pnpm publish --access public"},"_id":"@a-morphous/linear@1.0.2","_integrity":"sha512-EYUSyve4VKA7mxwvpsNK8aDdCVzz6C1SBpmqyzPgtxIUMgscQyliWnBqwX0ou5TPUQ9sisS+fFWL7Q/MNEKbMg==","_resolved":"/private/var/folders/pd/2r2pf8ln2cv61g2b_k9fr5nc0000gn/T/52e25ad06ea6c8ba619181fcb768a710/a-morphous-linear-1.0.2.tgz","_from":"file:a-morphous-linear-1.0.2.tgz","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-EYUSyve4VKA7mxwvpsNK8aDdCVzz6C1SBpmqyzPgtxIUMgscQyliWnBqwX0ou5TPUQ9sisS+fFWL7Q/MNEKbMg==","shasum":"b2508d1883b0ec3e32b8423fff3be5ab6f29b317","tarball":"https://registry.npmjs.org/@a-morphous/linear/-/linear-1.0.2.tgz","fileCount":5,"unpackedSize":9750,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGWfpvVTthPWAgz/5VV+0rey1Aauu3FclEFPM18fe9QCAiAnza67Uzlyw4wNMd/wxMyMF4JtaCgKuEUT/Up1zgNAjQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTi04ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGLg/+OOzHFawCCPEDZunpGDBzJQkf3OE/L167FczbdcSVpFSFulN6\r\nWYsTlxgDAY0ftBElVsHke2XbprPFH1nuh2Dd75gPHWyU89g9JUpKl9WkFVZ1\r\njx2S7+SD5/dsUaMXcLUVCxC0Cvaxwoq17P57kpypGxP5ua15mdtuRm/2YaV5\r\nL30nE+wahVDtr1aXffXimLDbfqnqlnSlDbyZow0oGXiGcoFY4aDiZgEu+f6t\r\n7INZhjdWG4XdxRz7gOmowBzqYeOHDtQn0X6c10RgSxvlWgQZQWn0VHoCKUWL\r\nU8Fz4imt45UtSsbEMpgcqtbUxC6b1L4mEAR/tyA+hFu/bbKVdo4Q+LnyGQ03\r\nSIzIuOuZFmO/Nv/lc+Kaycw3WsaGMacW+tviapsryRO+XiYbslCgeT8CZxxh\r\nu0r8CeP4LQsS/0rkEfTLL1Eq1C8IYZWybPpMAMfUuDamkbWYZQmUFIfrisXV\r\nIK1etBDbvhHSCwK0k3mgHJkSyMKtLBVWQt/To6MqxFW3i/SkbKc0HbyEaf2H\r\n3iB14h89JRckGsj22Fgeq+YGByeIbvSVxy2SoI5HZ2NEb3OVYAEJH/a7K/LJ\r\ngWTk2KbBop36Yu36TKmIwsqw3HwTeMIktkWwBwtXPc74fRvOKJJ7P+/OJNxu\r\nJSehjpIU4IG9wwfEGPOXt+zHtxk9qFD/SBI=\r\n=aohr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"},"directories":{},"maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/linear_1.0.2_1682844984138_0.8012899292590041"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-24T04:08:27.167Z","1.0.0":"2022-11-24T04:08:27.442Z","modified":"2023-04-30T08:56:24.423Z","1.0.1":"2023-04-11T16:27:21.115Z","1.0.2":"2023-04-30T08:56:24.282Z"},"maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"description":"Single-line configuration parser.","keywords":[],"license":"ISC","readme":"# Linear\n\nSingle-line configuration parser.\n\nNot very well documented yet.\n\n## Why?\n\nJSON, TOML, YAML -- are all very good at defining configuration when you have the space of a configuration file.\n\nBut for various markups, sometimes I want to add some data for a single line -- and there, the more readable variants (TOML and YAML) end up not really being useful there. In those cases, the best configurations are soemthing akin to command line arguments, where keys and values can all fit on a line.\n\nThus, `linear`. \n\n## Usage\n\n```js\nimport { parse } from '@a-morphous/linear\n\nparse(\"line-of-configuration\", {\n\t// configuration here\n\toperator: ['=', ':'], // the character(s) used for assignment, e.g. key=value or key:value here\n\tseparator: ',', // character(s) used to separate items\n\tstrict: false, // whether errors should be thrown from objects / arrays failing to parse\n})\n```\n\n## Spec\n\nLinear takes a string that can be on a single line, and has multiple configuration items\n\nVarious pieces are configurable, including:\n* `separator`: character(s) to separate different fields. By default is `,`, using ` ` will create space-separated fields. This can be set as a string or an array of strings, each ideally one character long.\n* `operator`: character(s) used to denote assignment, by default `=`. `:` is also common. This can be set as a string or an array of strings, each ideally one character long.\n\n...once those values are given, the result is an object of the following:\n\n```\n{\n\t_: string[],\n\tkey: \"value\"\n}\n```\n\nValues that aren't assigned a key are put into the `_` array in order. The keys are always strings.\n\n### Basic Types\n\nStrings, numbers, and booleans are converted automatically.\n\nAny number (that doesn't pass isNaN() in JS) is converted to a number. Numbers of the form `0x####` are converted to hexadecimal, numbers with decimal points `.` are converted to floats, otherwise to ints.\n\n`true` and `false` are converted to their boolean counterparts.\n\n### Quotes\n\nquoting a string with regular quotes turns it into a full string, even if the separator or assign operator is in there.\n\n```\nfoo=bar, \"foo=bar\"\n```\nwill produce\n```\n{\n\tfoo: 'bar',\n\t_: [\"foo=bar\"]\n}\n```\n\nIf you want a string to be wrapped by quotes, you need to double-wrap them\n```\n\"test\" -> test\n\"\"test\"\" -> \"test\"\n```\n\n### Nested Objects\n\nAnything nested between {} or [] are denoted as objects, and are parsed according to [json5](https://json5.org/) rules. (Json5 used to avoid needing internal quotes for all values, which can get messy quick.) Note that since this is assumed to be one line, you have to make your object on one line too. This is generally not a recommended format for making deeply nested configuration.\n\nNested objects only work as values. Keys are always strings, so will not be modified:\n```\n{test}={bar:\"foo\"}\n```\nwill produce\n```\n{\n\t\"{test}\":{\n\t\t\"bar\": \"foo\"\n\t}\n}\n```\n\n### Escaping\n\nA `\\` will escape the next character, and make it not behave as it normally would. So this is how you can enforce that `{}` or `[]`-wrapped text remains strings.\n\n#### What if an object fails to parse?\n\nYou can set `configuration.strict` to true, which will throw an error. Otherwise, behavior will be to emit a *warning*, and then fallback to sending the object as a string.\n\nArrays have similar behavior.","readmeFilename":"README.md"}