@eastworld/luci
v0.2.0
Published
Read and validate JSON configuration file
Maintainers
Readme
@eastworld/luci
Read and validate JSON configuration file.
Quickstart
import { readJsonFile } from 'luci'
const actual = readJsonFile('path/to/config.json', {
type: 'object',
additionalProperties: false,
required: ['host', 'port'],
properties: {
host: {
type: 'string',
format: 'hostname'
},
port: {
type: 'integer',
minimum: 0,
maximum: 65535
}
}
})Test
npm install
npm test