@sryden/unit
v1.0.2
Published
This is a Node.js module for reading and parsing basic SRYDEN Unit files.
Downloads
2
Readme
SRYDEN Unit
This is a Node.js module for reading and parsing basic SRYDEN Unit files.
Installation
npm install @sryden/unit
Example
index.js:
const unit = require('@sryden/unit');
// Example settings file
const settings = unit.file('./settings.unit');
if (settings) {
console.log(settings.myCategory.setting1);
console.log(settings.myOtherCategory.setting2);
} else {
console.error('Failed to load settings from file.');
}
settings.unit:
// Note: These are categories which contain settings and arrays
// Unit version 1.0.0
myCategory {
"setting1": "hello world",
"someArray": [
"1",
"2"
]
}
MyOtherCategory {
"setting2": "hello world"
}