
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
your .ini files parser with some extras
| Version | Published | By | URL |
|---|---|---|---|
| 0.0.60 | 2019-08-11 | codebloke | npm |
npm install --save config.ini
var configIni = require('config.ini');
For all examples below we are assuming following .ini file structure
# A comment
; This is a comment too
[SectionOne]
key = "value"
integer = 1234
real = 3.14
string1 = "Case 1"
string2 = 'Case 2'
multivalue[] = "first" # in-line comments
multivalue[] = 'second' # are supported as well
; Section: SectionTwo
[SectionTwo]
key = new value
integer = 1234
real = 3.14
string1 = Case 1
string2 = Case 2
string3 = Case 3
multivalue[] = first
multivalue[] = second
multivalue[] = third
Reading config from an .ini string with sections (For section-less feature see: #2)
var string = '',
conf = configIni.parse(string);
/// (...)
console.log(conf.SectionOne.integer);
// 1234
console.log(typeof conf.SectionOne.integer);
// 'number'
console.log(typeof conf.SectionTwo);
// 'object'
console.log(conf.SectionTwo.real);
// 3.14
/// (...)
Reading config from a file.ini
var conf = configIni.load('/yourFull/path/to/file.ini');
/// (...)
console.log(conf.SectionOne.integer);
// 1234
console.log(typeof conf.SectionOne.integer);
// 'number'
console.log(typeof conf.SectionTwo);
// 'object'
console.log(conf.SectionTwo.real);
// 3.14
/// (...)
var objToIniString = {
mysection: {
key: "string",
integer: 1234,
real: 3.14
}
};
console.log(configIni.stringify(objToIniString));
'
; Section: mysection
[mysection]
key = string
integer = 1234
real = 3.14
'
For the .ini file as follows:
[Japan]
miyamoto_musashi = "宮本武蔵"
[Germany]
gebhard_von_bluecher = "Gebhard-Leberecht von Blücher Fürst von Wahlstatt"
[ME]
salah_ad_din = "صلاحالدينيوسفبنأيوب"
we are getting back following object:
console.log(
{
Japan: {
miyamoto_musashi: '宮本武蔵'
},
Germany: {
gebhard_von_bluecher: 'Gebhard-Leberecht von Blücher Fürst von Wahlstatt'
},
ME: {
salah_ad_din: 'صلاحالدينيوسفبنأيوب'
}
}
);
FAQs
your .ini files parser with some extras
We found that config.ini demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.