{"id":16275220,"url":"https://github.com/ghostff/ini-parser","last_synced_at":"2026-04-26T23:31:14.600Z","repository":{"id":57113261,"uuid":"254724085","full_name":"Ghostff/ini-parser","owner":"Ghostff","description":"Converts an .ini file/string to javascript object","archived":false,"fork":false,"pushed_at":"2020-04-11T21:12:06.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T12:54:34.425Z","etag":null,"topics":["ini","ini-parser","js","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ghostff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-10T19:56:30.000Z","updated_at":"2022-09-04T19:13:28.000Z","dependencies_parsed_at":"2022-08-22T02:30:50.688Z","dependency_job_id":null,"html_url":"https://github.com/Ghostff/ini-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghostff%2Fini-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghostff%2Fini-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghostff%2Fini-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghostff%2Fini-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ghostff","download_url":"https://codeload.github.com/Ghostff/ini-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247880057,"owners_count":21011579,"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":["ini","ini-parser","js","nodejs"],"created_at":"2024-10-10T18:32:30.869Z","updated_at":"2026-04-26T23:31:14.570Z","avatar_url":"https://github.com/Ghostff.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# .INI Parser\nConverts an .ini file/string to javascript object. Supports section processing and typed value scan.\n## Installation\n```bash\nnpm i @ghostff/ini_parser\n```\n\n## Method Synopsis\n```js\nparse      (ini_string_or_filepath, callback, process_sections = true, scan = false)\nparseSync  (ini_string_or_filepath, process_sections = true, scan = false)\nparseString(ini_string, process_sections = true, scan = false)\n```\n\n## Usage\n##### Node\n```js\nvar iniParser = require('@ghostff/ini_parser');\n\n// Async\niniParser.parse('./example.ini', function(err, data) {\n    console.log(data);\n});\n\n// Sync\nvar data = iniParser.parseSync('./config.ini');\n\n// String\nvar data = iniParser.parseString(\"name=foo bar\");\n```\n##### Regular JS\n```js\nvar iniParser = require('@ghostff/ini_parser');\n\nvar data = iniParser.parse('' +\n  '; example.ini\\n' +\n  'name=foo bar\\n' +\n  'age=33\\n' +\n  'single=false'\n);\n```\n\n## Demo\n  - **process_sections:** By setting the `process_sections` parameter to `TRUE`, you get a nested object,\n   with the section names and settings included. The default for `process_sections` is `FALSE`.\n - **scan:**  When `scan` is set to `TRUE`, ini property value will be parsed. The default for `scan` is (`FALSE`).\n \n```ini\n; example.ini\nname=foo bar\ndatails[age] = 30\ndatails[single] = true\n\n[db]\nuser=foo\npass=null\n\n[app]\nsite_name=foobar\n```\n```js\niniParser.parseSync('./example.ini');\niniParser.parseSync('./example.ini', true); // process sections.\niniParser.parseSync('./example.ini', true, true); // process sections and use typed scan.\n```\nResult\n```js\n{\n  name: 'foo bar',\n  datails: { age: '30', single: 'true' },\n  user: 'foo',\n  pass: 'null',\n  site_name: 'foobar'\n}\n\n{\n  name: 'foo bar',\n  datails: { age: '30', single: 'true' },\n  db: { user: 'foo', pass: 'null' },\n  app: { site_name: 'foobar' }\n}\n\n{\n  name: 'foo bar',\n  datails: { age: 30, single: true },\n  db: { user: 'foo', pass: null },\n  app: { site_name: 'foobar' }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostff%2Fini-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostff%2Fini-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostff%2Fini-parser/lists"}