Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Library to read and write ini files
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
.gitignore
LICENSE
README.md
package.json

README.md

README

NPM

Installation

npm install multilevel-ini

or in package.json

...
"dependencies": {
    "multilevel-ini": "*",
}
...

API

var ini = require('multilevel-ini');
ini.get(filePath, callback);
ini.getSync(filePath);
ini.set(data, filePath, callback);
ini.setSync(data, filePath);
ini.objToIni(chunk, firstElementIsTitle, prefix);
ini.iniToObj(str);

Example

var ini = require('multilevel-ini');

ini.get('some.ini', function(error, result) {
    if (!error) {
        console.log('result', result);
    }
});

var obj = {
    'FirstZone': {
        'foo': 'any value',
        'bar': {
            'foo': [1,2,3,4,5]
        }
    },
    'SecondZone': {
        'foo': [
            'foo',
            'bar',
            'foo',
            'bar'
        ]
    }
};

ini.set(obj, 'some.ini', function(error, result) {
    if (error) {
        console.log(error);
        return;
    }
    console.log('save ok');
});

more in examples

Something went wrong with that request. Please try again.