{"id":19118818,"url":"https://github.com/heyputer/multiline-ini","last_synced_at":"2025-06-26T20:09:55.445Z","repository":{"id":176558901,"uuid":"613625102","full_name":"HeyPuter/multiline-ini","owner":"HeyPuter","description":"The first javascript INI parser supporting multiline strings.","archived":false,"fork":false,"pushed_at":"2023-04-17T17:05:58.000Z","size":16,"stargazers_count":30,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"trunk","last_synced_at":"2025-06-12T16:19:42.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/HeyPuter.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2023-03-14T00:07:51.000Z","updated_at":"2025-03-29T22:19:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5d01f06-fa03-421c-b4d6-2be0a6c02628","html_url":"https://github.com/HeyPuter/multiline-ini","commit_stats":null,"previous_names":["heyputer/multiline-ini"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/HeyPuter/multiline-ini","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyPuter%2Fmultiline-ini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyPuter%2Fmultiline-ini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyPuter%2Fmultiline-ini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyPuter%2Fmultiline-ini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HeyPuter","download_url":"https://codeload.github.com/HeyPuter/multiline-ini/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyPuter%2Fmultiline-ini/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262137149,"owners_count":23264674,"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-11-09T05:07:51.911Z","updated_at":"2025-06-26T20:09:55.432Z","avatar_url":"https://github.com/HeyPuter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Line INI Parser\n\n\u003ch3 align=\"center\"\u003e\u003cimg width=\"300\" alt=\"KV.JS logo\"\n    src=\"./doc/icon-with-text.svg\"\n\u003e\u003c/h3\u003e\n\u003cp align=\"center\"\u003eThe first javascript INI parser supporting multiline strings.\u003c/p\u003e\n\u003chr\u003e\n\n**multiline-ini** is a fast INI parser meant to support multiline strings\nand other syntax. It uses a state-machine parser which makes it possible\nto support features missing from other ini parsers that use the naive\n\"split-by-line then regex match\" approach.\n\nThe syntax of INI files is not standardized, so our approach is to treat\nsystemd's [config parser](https://github.com/systemd/systemd/blob/main/src/shared/conf-parser.c)\nas a reference implementation.\n\n## Installation\n```bash\nnpm install --save @heyputer/multiline-ini\n```\n\n## Usage\n```javascript\n// Require the module\nconst ini = require('@heyputer/multiline-ini');\n\n// Example: systemd-like input\nconst result = ini.parse(`\n[Service]\nType=simple\nExecStart=/bin/sh -c 'exec /usr/bin/my-exe \\\n\u003e\u003e/var/log/my-app/out.log \\\n2\u003e\u003e/var/log/my-app/err.log'\nEnvironment=NODE_ENV=production-linux\n`);\n\nconsole.log(JSON.stringify(result, null, '  ')); /*\n{\n  Service: {\n    Type: 'simple',\n    ExecStart: \"/bin/sh -c 'exec /usr/bin/my-exe \u003e\u003e/var/log/my-app/out.log 2\u003e\u003e/var/log/my-app/err.log'\",\n    Environment: 'NODE_ENV=production-linux'\n  }\n}\n*/\n```\n\n## Why `multiline-ini`?\n\nThis INI parser was created out of a need to parse systemd unit files.\nINI is not a standardized file format, but there is precedent for\n[escaping line feeds in INI values](https://en.wikipedia.org/wiki/INI_file#cite_note-multiline-entry-13).\nThis is supported by systemd.\n\nThe following INI parsers were tested and do not support multi-line values:\n\n| module name | problem | is regex | complexity |\n| ----------- | ------- | -------- | ---------- |\n| ini         | subsequent lines become keys with a value of true | yes | very over-engineered |\n| ini-parser  | subsequent lines ignored | yes | under 40 lines |\n| iniparser   | subsequent lines ignored | yes | under 70 lines |\n| node-ini    | broken release | yes | moderately over-engineered |\n\nThese parsers are all implemented using regex, and are designed to process each\nline individually searching for a `[section]` or `key=value` pair.\nThis makes it more challenging to add multiline support to an existing parser.\n\n## Contributing\n\n### In-Scope\n\nThe following items are in scope and contributions in these areas are\nwelcome.\n- support for all INI syntax supported by systemd with zero configuration\n  - i.e. we use systemd as a reference implementation for an INI standard\n- plugin support for handling other INI conventions\n\n## License\nDistributed under the MIT License. See [./LICENSE](./LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyputer%2Fmultiline-ini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheyputer%2Fmultiline-ini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyputer%2Fmultiline-ini/lists"}