New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

multi-ini

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-ini

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

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
increased by70.47%
Maintainers
1
Weekly downloads
 
Created
Source

multi-ini Build Status

Join the chat at https://gitter.im/evangelion1204/multi-ini

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
  • keep_quotes [false] - does not strip quotes around values
  • filters - predefined lowercase, uppercase, trim

Examples

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

This option is by default off to be backward compatible, if you ever need the value containing the quotes then use this.

key="value"

Enabling this option will result in "value" instead of value.

ini = require('multi-ini');
content = ini.read(file, {keep_quotes: false});
filters
MultiIni = require('multi-ini');
ini = new MultiIni.Class({
    filters: [MultiIni.filters.lowercase]
});
content = ini.read(file);

Define a custom filter

MultiIni = require('multi-ini');
ini = new MultiIni.Class({
    filters: [
        function (value) {
            return "Prepend " + value;
        }
    ]
});
content = ini.read(file);

Changelog

0.5.0

  • Added support for filters per value

0.4.0

  • Refactoring of the basic implementation to be no longer a singleton
  • Fixed a bug with wrong detected escaped double quotes

0.2.5

Now correctly reads

key= example

to the value "example" instead of "** example**"

0.2.4

Implemented 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.

0.2.3

Fixed a bug that the module was not recognized as a module by Node.

Keywords

FAQs

Package last updated on 10 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc