Skip to content

INI line-by-line parser for ArenaNet-styled INI files

Notifications You must be signed in to change notification settings

arenanet/arena-ini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arena-ini

INI line-by-line parser for ArenaNet-styled INI files. Supports duplicated keys per section because that's how we write INI files.

Usage

var fs     = require("fs"),
    parser = require("arena-ini"),
    ini;

ini = parser(fs.readFileSync("./test.ini", "utf8"));

// If ./test.ini looks like this
/*
 * [section]
 *     key = value
 *     key = values, values, values
 * 
 * [section2]
 *     key = value value value
 */

// ini now contains an object like this
/*
 * {
 *     "section" : [
 *         {
 *             name   : "key",
 *             value  : "value"
 *             values : [
 *                 "value"
 *             ]
 *         },
 *         {
 *             name   : "key",
 *             value  : "values, values, values"
 *             values : [
 *                 "values",
 *                 "values",
 *                 "values"
 *             ]
 *         },
 *     ],
 *     
 *     "section2" : [
 *         {
 *             name   : "key",
 *             value  : "value value value"
 *             values : [
 *                 "value value value"
 *             ]
 *         }
 *     ]
 * }
 *
 */

About

INI line-by-line parser for ArenaNet-styled INI files

Resources

Stars

Watchers

Forks

Packages

No packages published