0.0.2 • Published 7 years ago

parse-kv-file v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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' }