{"name":"ini","version":"6.0.0","author":{"name":"GitHub Inc."},"license":"ISC","_id":"ini@6.0.0","maintainers":[{"name":"gar","email":"gar+npm@danger.computer"},{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"reggi","email":"reggi@github.com"},{"name":"hashtagchris","email":"hashtagchris@github.com"},{"name":"owlstronaut","email":"owlstronaut@github.com"}],"homepage":"https://github.com/npm/ini#readme","bugs":{"url":"https://github.com/npm/ini/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"efc7642b276f6a37d22fdf56ef50889d7146bf30","tarball":"http://registry-npm.ywwl.com/ini/download/ini-6.0.0.tgz","fileCount":4,"integrity":"sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==","signatures":[{"sig":"MEUCIQCw90cF5ilrEWMLD4sdVxbvGV/4emPe03wo3Or6MwExuAIga9kWfYzGwVtBPPX29n7KOrMIJkk/4q4tBgLSaZ9C0JY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ini@6.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12130,"size":4910,"noattachment":false,"key":"/ini/-/ini-6.0.0.tgz"},"main":"lib/ini.js","engines":{"node":"^20.17.0 || >=22.9.0"},"gitHead":"180a8d5c72d7f13ed70c53619132f3a8ee5ac6ed","scripts":{"lint":"npm run eslint","snap":"tap","test":"tap","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","lintfix":"npm run eslint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3cb14e0e-7607-405c-b29d-a78739ec7a1d"}},"repository":{"url":"git+https://github.com/npm/ini.git","type":"git"},"_npmVersion":"11.6.2","description":"An ini encoder/decoder for node","directories":{},"templateOSS":{"publish":"true","version":"4.27.1","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","@npmcli/template-oss":"4.27.1","@npmcli/eslint-config":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ini_6.0.0_1761146695179_0.41137167941494135","host":"s3://npm-registry-packages-npm-production"},"readme":"\nAn INI format parser & serializer.\n\n## Note\n\n-   Sections are treated as nested objects.\n\n-   Section-less items are treated as globals.\n\n## Usage\n\nConsider an INI file such as the following:\n\n```ini\n; This comment is being ignored\nscope = global\n\n[database]\nuser = dbuser\npassword = dbpassword\ndatabase = use_this_database\n\n[paths.default]\ndatadir = /var/lib/data\narray[] = first value\narray[] = second value\narray[] = third value\n```\n\nYou can **read**, **modify** and **write** it like so:\n\n```js\nimport { writeFile , readFile } from 'node:fs/promises'\nimport { stringify , parse } from 'ini'\n\n//  Read INI file as text\n\nlet text = await readFile(`./Original.ini`,{\n    encoding : 'utf-8'\n})\n\n//  Parse text data to object\n\nconst config = parse(text)\n\n//  Modify data object\n\nconfig.scope = 'local'\nconfig.database.database = 'use_another_database'\nconfig.paths.default.tmpdir = '/tmp'\ndelete config.paths.default.datadir\nconfig.paths.default.array.push('fourth value')\n\n//  Stringify data object\n\ntext = stringify(config,{ \n    section : 'section' \n})\n\n//  Write INI file as text\n\nawait writeFile(`./Modified.ini`,text)\n```\n\nThe written file will contain the following:\n\n```ini\n[section]\nscope=local\n[section.database]\nuser=dbuser\npassword=dbpassword\ndatabase=use_another_database\n[section.paths.default]\ntmpdir=/tmp\narray[]=first value\narray[]=second value\narray[]=third value\narray[]=fourth value\n```\n\n## API\n\n### Parse\n\nAttempts to turn the given INI string into a nested data object.\n\n```js\n// You can also use `decode`\nconst object = parse(`<INI Text>`) \n```\n\n### Stringify\n\nEncodes the given data object as an INI formatted string.\n\n```js\n// You can also use `encode`\nstringify(object,{\n\n    /**\n     *  Whether to insert spaces before & after `=`\n     * \n     *  Disabled by default to have better \n     *  compatibility with old picky parsers.\n     */\n\n    whitespace : false ,\n\n    /**\n     *  Whether to align the `=` character for each section.\n     *  -> Also enables the `whitespace` option\n     */\n\n    align : false ,\n\n    /**\n     *  Identifier to use for global items \n     *  and to prepend to all other sections.\n     */\n\n    section ,\n\n    /**\n     *  Whether to sort all sections & their keys alphabetically.\n     */\n\n    sort : false ,\n\n    /**\n     *  Whether to insert a newline after each section header.\n     * \n     *  The TOSHIBA & FlashAir parser require this format. \n     */\n\n    newline : false ,\n\n    /**\n     *  Which platforms line-endings should be used.\n     * \n     *  win32 -> CR+LF\n     *  other -> LF\n     * \n     *  Default is the current platform\n     */\n\n    platform ,\n\n    /**\n     *  Whether to append `[]` to array keys.\n     * \n     *  Some parsers treat duplicate names by themselves as arrays\n     */\n\n    bracketedArray : true\n\n})\n```\n\n*For backwards compatibility any string passed as the*  \n*options parameter is treated as the `section` option.*\n\n```js\nstringify(object,'section')\n```\n\n### Un / Escape\n\nTurn the given string into a safe to  \nuse key or value in your INI file.\n\n```js\nsafe(`\"unsafe string\"`) // -> \\\"unsafe string\\\"\n```\n\nOr reverse the process with:\n\n```js\nunsafe(`\\\\\"safe string\\\\\"`) // -> \"safe string\"\n```\n","publish_time":1761146695354,"_cnpm_publish_time":1761146695354,"dist-tags":{"latest":"7.0.0"}}