3.2.2 • Published 1 year ago

kv-reader v3.2.2

Weekly downloads
59
License
BSD-2-Clause
Repository
github
Last release
1 year 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

1 year ago

3.2.1

1 year ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.16

2 years ago

3.0.17

2 years ago

3.0.14

2 years ago

3.0.15

2 years ago

3.0.13

2 years ago

3.0.12

2 years ago

3.0.11

2 years ago

3.0.10

3 years ago

3.0.9

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago