parse-kv-file
v0.0.2
Published
Pare a kv file, return an object.
Downloads
2
Readme
parse-kv-file
Pare a kv file, return an object. Zero dependencies.
install
npm install parse-kv-file
hello parse-kv-file
If we have a file follow follwing format:
foo=xxx
bar=xxx
Then we can parse it to an object.
const parseKvFile = require('parse-kv-file');
const fileStr = `foo=xxx
bar=xxx`
console.log(parseKvFile(fileStr));
// { foo: 'xxx', bar: 'xxx' }