3.2.2 • Published 2 years ago

kv-reader v3.2.2

Weekly downloads
59
License
BSD-2-Clause
Repository
github
Last release
2 years ago

npm License Open Bundle downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

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

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

license

BSD-2-Clause

3.2.2

2 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.16

3 years ago

3.0.17

3 years ago

3.0.14

3 years ago

3.0.15

3 years ago

3.0.13

3 years ago

3.0.12

3 years ago

3.0.11

3 years ago

3.0.10

4 years ago

3.0.9

4 years ago

3.0.8

4 years ago

3.0.7

4 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

6 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago