read-ini-file
!--@shields('npm')--Read and parse an ini file
Installation
pnpm add read-ini-file
Usage
!--@example('./example/index.js')--'use strict'
const { readIniFile } = require('read-ini-file')
const path = require('path')
const fixture = path.join(__dirname, 'currencies.ini')
const currencies = loadIniFile.sync(fixture)
console.log(currencies)
//> { USA: 'USD', Ukraine: 'UAH', Hungary: 'HUF' }
!--/@--
API
readIniFile(filepath)
Returns a promise for the parsed ini.
readIniFileSync(filepath)
Returns the parsed ini.
Related
- write-ini-file - Stringify and write ini to a file atomically
- ini - An ini parser/serializer in JavaScript