JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5375
  • Score
    100M100P100Q123530F

An ini-file parser which supports multi line, multiple levels and arrays to get a maximum of compatibility with Zend config files.

Package Exports

  • multi-ini

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (multi-ini) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

multi-ini Build Status

An ini-file parser which supports multi line, multiple levels and arrays to get a maximum of compatibility with Zend config files.

Install

npm install multi-ini

Usage

ini = require('multi-ini');
content = ini.read(file);
content.section.key = value;
ini.write(file, content);

Options

Following options are available:

  • encoding [*'utf8'*] - directly passed to readFileSync
  • ignore_invalid [true] - controls if invalid key/values are ignored or processed
  • oninvalid - callback function if an invalid key/value is found - return false aborts parsing true continues

Examples

encoding

ini = require('multi-ini');
content = ini.read(file, {encoding: 'utf8'});
content.section.key = value;
ini.write(file, content, {encoding: 'utf8'});

ignore_invalid

ini = require('multi-ini');
content = ini.read(file, {ignore_invalid: false});

oninvalid

cb = function (line) {
    /* do something like logging or output the line which is invalid and abort with false */
    return false
};

ini = require('multi-ini');
content = ini.read(file, {oninvalid: cb});