Skip to content

Commit 3f79789

Browse files
committed
docs(readme): update
1 parent 5d049f4 commit 3f79789

2 files changed

Lines changed: 153 additions & 2 deletions

File tree

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2021 Antelle
1+
Copyright (C) 2021-2025 Antelle
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1717
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1818
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1919
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,55 @@
22

33
KdbxWeb is a high-performance javascript library for reading/writing KeePass v2 databases (kdbx) in node.js or browser.
44

5+
<br />
6+
7+
---
8+
9+
<br />
10+
11+
- [KdbxWeb ](#kdbxweb--)
12+
- [Features](#features)
13+
- [Browser support](#browser-support)
14+
- [Compatibility](#compatibility)
15+
- [Kdbx4](#kdbx4)
16+
- [Usage](#usage)
17+
- [Loading](#loading)
18+
- [Saving](#saving)
19+
- [File info](#file-info)
20+
- [Changing credentials](#changing-credentials)
21+
- [Creation](#creation)
22+
- [Maintenance](#maintenance)
23+
- [Merge](#merge)
24+
- [Groups](#groups)
25+
- [Group creation](#group-creation)
26+
- [Group deletion](#group-deletion)
27+
- [Group move](#group-move)
28+
- [Recycle Bin](#recycle-bin)
29+
- [Recursive traverse](#recursive-traverse)
30+
- [Entries](#entries)
31+
- [Entry creation](#entry-creation)
32+
- [Entry modification](#entry-modification)
33+
- [Entry deletion](#entry-deletion)
34+
- [Entry move](#entry-move)
35+
- [ProtectedValue](#protectedvalue)
36+
- [Errors](#errors)
37+
- [Consts](#consts)
38+
- [Random](#random)
39+
- [ByteUtils](#byteutils)
40+
- [Building](#building)
41+
- [3rd party libs](#3rd-party-libs)
42+
- [Tools](#tools)
43+
- [See it in action](#see-it-in-action)
44+
- [Extras](#extras)
45+
- [License](#license)
46+
47+
48+
<br />
49+
50+
---
51+
52+
<br />
53+
554
## Features
655

756
- runs in browser or node.js
@@ -14,15 +63,33 @@ KdbxWeb is a high-performance javascript library for reading/writing KeePass v2
1463
- high code coverage
1564
- strict TypeScript
1665

66+
<br />
67+
68+
---
69+
70+
<br />
71+
1772
## Browser support
1873

1974
- modern browsers: Chrome, Firefox, Safari, Opera, Edge
2075
- node.js
2176

77+
<br />
78+
79+
---
80+
81+
<br />
82+
2283
## Compatibility
2384

2485
Supported formats are Kdbx3 and Kdbx4, current KeePass file format. Old kdb files (for KeePass v1) are out of scope of this library.
2586

87+
<br />
88+
89+
---
90+
91+
<br />
92+
2693
## Kdbx4
2794

2895
Kdbx4 has introduced Argon2, a new hashing function. Due to complex calculations, you have to implement it manually and export to kdbxweb, if you want to support such files. Here's how:
@@ -40,6 +107,12 @@ You can find an implementation example in [tests](https://github.com/keeweb/kdbx
40107

41108
It's not compiled into the library because there's no universal way to provide a fast implementation, so it's up to you, to choose the best one.
42109

110+
<br />
111+
112+
---
113+
114+
<br />
115+
43116
## Usage
44117

45118
##### Loading
@@ -63,6 +136,8 @@ You can also pretty-print XML:
63136
const prettyPrintedXml = await db.saveXml(true);
64137
```
65138

139+
<br />
140+
66141
##### File info
67142
```ts
68143
db.header
@@ -88,6 +163,8 @@ let group = newDb.createGroup(newDb.getDefaultGroup(), 'subgroup');
88163
let entry = newDb.createEntry(group);
89164
```
90165

166+
<br />
167+
91168
##### Maintenance
92169

93170
```ts
@@ -107,6 +184,8 @@ db.setVersion(3);
107184
db.setKdf(kdbxweb.Consts.KdfId.Aes);
108185
```
109186

187+
<br />
188+
110189
##### Merge
111190

112191
Entries, groups and meta are consistent against merging in any direction with any state.
@@ -133,30 +212,40 @@ if (pushedOk) {
133212
}
134213
```
135214

215+
<br />
216+
136217
##### Groups
137218
```ts
138219
let defaultGroup = db.getDefaultGroup();
139220
let anotherGroup = db.getGroup(uuid);
140221
let deepGroup = defaultGroup.groups[1].groups[2];
141222
```
142223

224+
<br />
225+
143226
##### Group creation
144227
```ts
145228
let group = db.createGroup(db.getDefaultGroup(), 'New group');
146229
let anotherGroup = db.createGroup(group, 'Subgroup');
147230
```
148231

232+
<br />
233+
149234
##### Group deletion
150235
```ts
151236
db.remove(group);
152237
```
153238

239+
<br />
240+
154241
##### Group move
155242
```ts
156243
db.move(group, toGroup);
157244
db.move(group, toGroup, atIndex);
158245
```
159246

247+
<br />
248+
160249
##### Recycle Bin
161250
```ts
162251
let recycleBin = db.getGroup(db.meta.recycleBinUuid);
@@ -165,25 +254,33 @@ if (!recycleBin) {
165254
}
166255
```
167256

257+
<br />
258+
168259
##### Recursive traverse
169260
```ts
170261
for (const entry of group.allEntries()) { /* ... */ }
171262
for (const group of group.allGroups()) { /* ... */ }
172263
for (const entryOrGroup of group.allGroupsAndEntries()) { /* ... */ }
173264
```
174265

266+
<br />
267+
175268
##### Entries
176269
```ts
177270
let entry = db.getDefaultGroup().entries[0];
178271
entry.fields.AccountNumber = '1234 5678';
179272
entry.fields.Pin = kdbxweb.ProtectedValue.fromString('4321');
180273
```
181274

275+
<br />
276+
182277
##### Entry creation
183278
```ts
184279
let entry = db.createEntry(group);
185280
```
186281

282+
<br />
283+
187284
##### Entry modification
188285
```ts
189286
// push current state to history stack
@@ -197,11 +294,15 @@ entry.removeHistory(index, count);
197294
```
198295
Important: don't modify history states directly, this will break merge.
199296

297+
<br />
298+
200299
##### Entry deletion
201300
```ts
202301
db.remove(entry);
203302
```
204303

304+
<br />
305+
205306
##### Entry move
206307
```ts
207308
db.move(entry, toGroup);
@@ -212,6 +313,8 @@ If you're moving an entry from another file, this is called _import_:
212313
db.importEntry(entry, toGroup, sourceFile);
213314
```
214315

316+
<br />
317+
215318
##### ProtectedValue
216319
Used for passwords and custom fields, stored the value in memory XOR'ed
217320
```ts
@@ -234,6 +337,8 @@ try {
234337
}
235338
```
236339

340+
<br />
341+
237342
##### Consts
238343
[Consts definition](https://github.com/keeweb/kdbxweb/blob/master/lib/defs/consts.ts)
239344
```ts
@@ -242,11 +347,15 @@ kdbxweb.Consts.Defaults // default db settings
242347
kdbxweb.Consts.Icons // icons map
243348
```
244349

350+
<br />
351+
245352
##### Random
246353
```ts
247354
let randomArray = kdbxweb.Crypto.random(/* desired length */ 100);
248355
```
249356

357+
<br />
358+
250359
##### ByteUtils
251360
```ts
252361
kdbxweb.ByteUtils.bytesToString(bytes);
@@ -257,6 +366,12 @@ kdbxweb.ByteUtils.bytesToHex(bytes);
257366
kdbxweb.ByteUtils.hexToBytes(str);
258367
```
259368

369+
<br />
370+
371+
---
372+
373+
<br />
374+
260375
## Building
261376

262377
Use npm to build this project:
@@ -269,12 +384,24 @@ To run tests:
269384
npm test
270385
```
271386

387+
<br />
388+
389+
---
390+
391+
<br />
392+
272393
## 3rd party libs
273394

274395
kdbxweb includes these 3rd party libraries:
275396
- [fflate](https://github.com/101arrowz/fflate)
276397
- [xmldom](https://github.com/xmldom/xmldom)
277398

399+
<br />
400+
401+
---
402+
403+
<br />
404+
278405
## Tools
279406

280407
The library provides a number of scripts to work with KDBX files:
@@ -284,31 +411,55 @@ Dump the binary header:
284411
npm run script:dump-header my-db.kdbx
285412
```
286413

414+
<br />
415+
287416
Print detailed size information about internal objects:
288417
```sh
289418
npm run script:kdbx-size-profiler my-db.kdbx password
290419
```
291420

421+
<br />
422+
292423
Dump the internal XML:
293424
```sh
294425
npm run script:kdbx-to-xml my-db.kdbx password
295426
```
296427

428+
<br />
429+
297430
Generate big files for load testing:
298431
```sh
299432
npm run script:make-big-files
300433
```
301434

435+
<br />
436+
437+
---
438+
439+
<br />
440+
302441
## See it in action
303442

304443
This library is used in [KeeWeb](https://app.keeweb.info)
305444

445+
<br />
446+
447+
---
448+
449+
<br />
450+
306451
## Extras
307452

308453
We also provide a template for [HexFiend](https://github.com/ridiculousfish/HexFiend)
309454
to explore the contents of KDBX files, you can find it
310455
[here](format).
311456

457+
<br />
458+
459+
---
460+
461+
<br />
462+
312463
## License
313464

314465
MIT

0 commit comments

Comments
 (0)