https://github.com/cycoresystems/meteor-ini
Meteor wrapper for NPM's `ini` package
https://github.com/cycoresystems/meteor-ini
Last synced: 12 months ago
JSON representation
Meteor wrapper for NPM's `ini` package
- Host: GitHub
- URL: https://github.com/cycoresystems/meteor-ini
- Owner: CyCoreSystems
- Created: 2016-01-28T09:27:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-28T20:23:23.000Z (over 10 years ago)
- Last Synced: 2025-02-25T15:03:41.365Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```js
var out = parseINI('
name=Charles ;; Comment!
[stats]
height=108 # I am really a comment, too=foo
weight=52
');
```
Would return:
```js
out = {
global: {
name: 'Charles'
},
stats: {
height: '108',
weight: '52'
}
}
```