kv-reader
v3.2.2
Published
decode kv config files as used by subversion
Downloads
82
Readme
kv-reader
decode kv config files as used by subversion
example
K 8
passtype
V 8
keychain
K 15
svn:realmstring
V 62
<https://subversion.assembla.com:443> Assembla Restricted Area
K 8
username
V 7
abcdefg
END
import { createReadStream } from "fs";
import { reader } from "kv-reader";
async function sample() {
const kv = {};
await reader(
createReadStream("tests/fixtures/s1"),
(key, value) => (kv[key] = value)
);
console.log(`passtype = ${kv.passtype}`);
}
sample();
passtype = keychain
svn:realmstring = <https://subversion.assembla.com:443> Assembla Restricted Area
username = abcdefg
API
Table of Contents
reader
Transforms a input stream of kv data into a object with key value pairs assigned
Parameters
stream
StreamgotValue
ValueProvider
Returns Promise resolving to object
ValueProvider
call back function to provide key and value
Type: Function
Parameters
install
With npm do:
npm install kv-reader