Skip to content

CyCoreSystems/meteor-ini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ini

This is a crude native INI file parser. There are two exposed methods:

  • parseINIFile() which takes a filename and parses it as an INI
  • parseINI() which takes string input and parses it as INI

Both methods return an object (which may be empty) representing the INI. The sections are represented by the first index, keys by the second. Top entries without a section are considered being part of the global section.

Also, no attempt is made to parse the values into anything but their native strings. The only thing done to them is to trim whitespace from around them.

Hence:

var out = parseINI('
   name=Charles ;; Comment!
   [stats]
   height=108  # I am really a comment, too=foo
   weight=52
');

Would return:

out = {
   global: {
      name: 'Charles'
   },
   stats: {
      height: '108',
      weight: '52'
   }
}

About

Meteor wrapper for NPM's `ini` package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published