{"name":"multi-ini","version":"2.3.1","license":"MIT","description":"An ini-file parser which supports multi line, multiple levels and arrays to get a maximum of compatibility with Zend config files.","main":"lib/index.js","scripts":{"_build:cjs":"tsc --outDir dist","_build:es":"tsc  --module es6 --moduleResolution node --outDir lib","predistribute":"babel src --out-dir lib","test":"babel-node ./node_modules/.bin/_mocha","distribute":"npm publish"},"homepage":"https://github.com/evangelion1204/multi-ini","author":{"name":"Michael Iwersen","email":"mi.iwersen@gmail.com"},"repository":{"type":"git","url":"git://github.com/evangelion1204/multi-ini.git"},"bugs":{"url":"https://github.com/evangelion1204/multi-ini/issues"},"licenses":[{"type":"MIT","url":"https://github.com/evangelion1204/multi-ini/blob/master/LICENSE"}],"keywords":["ini","zend","config","multi-line","multi-level"],"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/node":"^7.6.1","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-export-default-from":"^7.0.0","@babel/plugin-proposal-export-namespace-from":"^7.0.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.13.8","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-proposal-optional-chaining":"^7.13.12","@babel/plugin-transform-react-constant-elements":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/preset-typescript":"^7.0.0","@babel/register":"^7.0.0","@babel/runtime":"^7.0.0","babel-core":"7.0.0-bridge.0","babel-eslint":"^10.0.1","babel-loader":"^8.0.4","babel-plugin-module-resolver":"^3.1.1","babel-plugin-styled-components":"^1.9.2","babel-register":"^6.26.0","benchmark":"^2.0.0","chai":"^3.4.1","mocha":"^9.2.2","nyc":"^15.1.0","sinon":"^1.17.2","sinon-chai":"^2.8.0"},"dependencies":{"lodash":"^4.0.0"},"gitHead":"e636218fecd25c9e9bcb96f56196425bf0be1118","_id":"multi-ini@2.3.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-jFHzUZPdFrOdd43386PuKbPtj+2T62+jIeW2G7ct2qTwAcZy2YK/PP+GOsr3x2mReDpmvbg21WlopyiEvH6lCg==","shasum":"88a6e24ed7c08c3e9bb129a1b7509f0a43bf11d0","tarball":"http://registry-npm.ywwl.com/multi-ini/download/multi-ini-2.3.1.tgz","fileCount":48,"unpackedSize":182853,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChwbrtUNlns64sweDAEjhuwq0mNfALWyGjJ4DofuNT+gIgG9rEIR31iqzYfzKoLgl7qKPLDCaj47IXG2flwH5dsVM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQGbrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJQw//VZPj/Sne4Gc87wXLyDURQGEN6f1Pm4F4O6d4hnHd7Xas6B5V\r\n6IIq3hEtwxz+HiAGPCtEeV6oDd5UJK/HdQ9pYjtkKDBkG+VPPMeeio5PJMSp\r\nVlO9cTMyRjNV4F9w9qq7hxFxX/pb+rjNnb3niBenYsCUe1D1HG9LBMWVUmi9\r\nPkdMDe6edBUZiuRZ6v9TdZf3/tC8hDuqsGE3sksqfP+F/I8+hvxbklFvz8Zm\r\n5R+vCRee8ddoAO/mqZ9k2+me+n5urQ0FQvcF26RZT9CZe+8m1DqhwlxsoiTd\r\n8t0552bLpsh0neJPgg+yFA2T/X26cW3BlapTvML4fVnCRKKQ5FB0MQi5UxDN\r\nYl3hdUvvH4Gl2jithfi4PT5bXI+apEClAne9eoFfUEJ2mdRgrL1+qz28/LRQ\r\n/dzWQJfQoe7MEsPZ/HW8NJwkg5P/CFEx3Px66aiymWMpj9tr4Ew9mjf5Cg6L\r\nGhnnAlUI3XadmFojoBz7S/x4iAfy8UKgSnA+BfCDAtxEReD3m2uGfcQYq1nm\r\nD/7/yGme+WJSV2AQcXOfXTcWr0mWHe7h09wpH7vgzEtLrbR1AWEqLxO89N3O\r\nBELRX/WJK4FYcr9Z6RvdzYyn8qhYi3lONs0wZKRhZeUrB9szoxeaw0SOFzYj\r\nMd2lOMV0ujxtweMvWQC7mKcbHJlWH/UE6Z0=\r\n=e0Y+\r\n-----END PGP SIGNATURE-----\r\n","size":49030,"noattachment":false,"key":"/multi-ini/-/multi-ini-2.3.1.tgz"},"_npmUser":{"name":"mgeppert","email":"mi.iwersen@gmail.com"},"directories":{},"maintainers":[{"name":"mgeppert","email":"mi.iwersen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multi-ini_2.3.1_1665165035396_0.4345197290945495"},"_hasShrinkwrap":false,"readme":"# multi-ini [![Build Status](https://travis-ci.org/evangelion1204/multi-ini.png?branch=master)](https://travis-ci.org/evangelion1204/multi-ini) [![Coverage Status](https://coveralls.io/repos/evangelion1204/multi-ini/badge.svg?branch=master)](https://coveralls.io/r/evangelion1204/multi-ini?branch=master)\n\n[![Join the chat at https://gitter.im/evangelion1204/multi-ini](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/evangelion1204/multi-ini?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\nAn ini-file parser which supports multi line, multiple levels and arrays to get a maximum of compatibility with Zend config files.\n\n## Install\n\n```shell\nnpm install multi-ini\n```\n\n## Usage\n\n```js\nini = require('multi-ini');\ncontent = ini.read(file);\ncontent.section.key = value;\nini.write(file, content);\n```\n\n## Options\n\nFollowing options are available:\n\n-   encoding \\[_'utf8'_\\] - directly passed to readFileSync\n-   keep_quotes \\[_false_\\] - does not strip quotes around values\n-   filters - predefined _lowercase_, _uppercase_, _trim_, _constants_, _boolean_, _integer_\n-   nested_section_names \\[_false_\\] - support to parse section names e.g. `[section.subsection]`\n-   keep_zero_prefix \\[_false_\\] - controls the integer parsing by ignoring numbers with leading 0\n\n### Examples\n\n#### encoding\n\n```js\nini = require('multi-ini');\ncontent = ini.read(file, { encoding: 'utf8' });\ncontent.section.key = value;\nini.write(file, content, { encoding: 'utf8' });\n```\n\n#### keep_quotes\n\nThis option is by default off to be backward compatible, if you ever need the value containing the quotes then use this.\n\n```ini\nkey=\"value\"\n```\n\nEnabling this option will result in **\"value\"** instead of **value**.\n\n```js\nini = require('multi-ini');\ncontent = ini.read(file, { keep_quotes: true });\n```\n\nThis will also affect the Serializer and serialized values. Using it will not quote anything automatically.\n\n```js\n{\n    production: {\n        quoted: '\"quoted\"',\n        not_quoted: 'not_quoted'\n    }\n}\n```\n\nWill result in a ini like\n\n```ini\n[production]\nquoted=\"quoted\"\nnot_quotes=not_quoted\n```\n\n#### filters\n\n```js\nMultiIni = require('multi-ini');\nini = new MultiIni.Class({\n    filters: [MultiIni.filters.lowercase],\n});\ncontent = ini.read(file);\n```\n\n_Replacing constants_\n\n```js\nMultiIni = require('multi-ini');\nini = new MultiIni.Class({\n    constants: { CONSTANT: 'replacement' },\n    filters: [MultiIni.filters.constants],\n});\ncontent = ini.read(file);\n```\n\n_Define a custom filter_\n\n```js\nMultiIni = require('multi-ini');\nini = new MultiIni.Class({\n    filters: [\n        function (value) {\n            return 'Prepend ' + value;\n        },\n    ],\n});\ncontent = ini.read(file);\n```\n\n#### line_breaks\n\nEither `unix` or `windows` for line breaks.\n\n```js\nini = require('multi-ini');\ncontent = ini.read(file, { line_breaks: 'windows' });\ncontent.section.key = value;\n```\n\n#### nested_section_names\n\nUsing `nested_section_names` will parse nested section names having a `.`.\n\n```js\nini = require('multi-ini');\ncontent = ini.read(file, { nested_section_names: true });\n```\n\n```ini\n[section.subsection]\nkey=\"value\"\n```\n\nWill result in\n\n```json\n{\n    \"section\": {\n        \"subsection\": {\n            \"key\": \"value\"\n        }\n    }\n}\n```\n\n#### Parser\n\nIt's also possible to parse a ini file from an array of strings.\n\n```js\nini = require('multi-ini');\nparser = new ini.Parser();\ncontent = parser.parse(lines);\n```\n\n#### Serializer\n\nLike parsing it's also possible to serialize an ini object to a string.\n\n```js\nini = require('multi-ini');\nserializer = new ini.Serializer();\ncontent = serializer.serialize({\n    production: {\n        base_url: 'https://google.com',\n    },\n});\n```\n\n## Changelog\n\n### 2.2.0\n\n-   Support for nested section names\n-   filter for integer parsing\n\n### 2.1.2\n\n-   Fixed prototype pollution by ignoring `constructor` and `prototype`\n\n### 2.1.1\n\n-   Fixed prototype pollution by ignoring `__proto__`\n\n### 1.0.1\n\n-   Fixed bug with `keep_quotes` ignored when writing files\n\n### 1.0.0\n\n-   First full release keeping backwards compatibility\n\n### 0.5.2\n\n-   Introduced option for line breaks\n\n### 0.5.1\n\n-   Fixed a bug where single lines of multilines got trimmed\n\n### 0.5.0\n\n-   Added support for filters per value\n\n### 0.4.0\n\n-   Refactoring of the basic implementation to be no longer a singleton\n-   Fixed a bug with wrong detected escaped double quotes\n\n### 0.2.5\n\nNow correctly reads\n\n```ini\nkey= example\n```\n\nto the value \"**example**\" instead of \"** example**\"\n\n### 0.2.4\n\nImplemented support for constants and removed a lot of bugs and the options **ignore_invalid** and **oninvalid**, this may be introduced again but are currently not necessary.\n\n### 0.2.3\n\nFixed a bug that the module was not recognized as a module by Node.\n","publish_time":1665165035626,"_cnpm_publish_time":1665165035626,"dist-tags":{"latest":"2.3.2"}}