You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+151Lines changed: 151 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,55 @@
2
2
3
3
KdbxWeb is a high-performance javascript library for reading/writing KeePass v2 databases (kdbx) in node.js or browser.
4
4
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
+
5
54
## Features
6
55
7
56
- runs in browser or node.js
@@ -14,15 +63,33 @@ KdbxWeb is a high-performance javascript library for reading/writing KeePass v2
14
63
- high code coverage
15
64
- strict TypeScript
16
65
66
+
<br />
67
+
68
+
---
69
+
70
+
<br />
71
+
17
72
## Browser support
18
73
19
74
- modern browsers: Chrome, Firefox, Safari, Opera, Edge
20
75
- node.js
21
76
77
+
<br />
78
+
79
+
---
80
+
81
+
<br />
82
+
22
83
## Compatibility
23
84
24
85
Supported formats are Kdbx3 and Kdbx4, current KeePass file format. Old kdb files (for KeePass v1) are out of scope of this library.
25
86
87
+
<br />
88
+
89
+
---
90
+
91
+
<br />
92
+
26
93
## Kdbx4
27
94
28
95
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
40
107
41
108
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.
42
109
110
+
<br />
111
+
112
+
---
113
+
114
+
<br />
115
+
43
116
## Usage
44
117
45
118
##### Loading
@@ -63,6 +136,8 @@ You can also pretty-print XML:
63
136
const prettyPrintedXml =awaitdb.saveXml(true);
64
137
```
65
138
139
+
<br />
140
+
66
141
##### File info
67
142
```ts
68
143
db.header
@@ -88,6 +163,8 @@ let group = newDb.createGroup(newDb.getDefaultGroup(), 'subgroup');
88
163
let entry =newDb.createEntry(group);
89
164
```
90
165
166
+
<br />
167
+
91
168
##### Maintenance
92
169
93
170
```ts
@@ -107,6 +184,8 @@ db.setVersion(3);
107
184
db.setKdf(kdbxweb.Consts.KdfId.Aes);
108
185
```
109
186
187
+
<br />
188
+
110
189
##### Merge
111
190
112
191
Entries, groups and meta are consistent against merging in any direction with any state.
@@ -133,30 +212,40 @@ if (pushedOk) {
133
212
}
134
213
```
135
214
215
+
<br />
216
+
136
217
##### Groups
137
218
```ts
138
219
let defaultGroup =db.getDefaultGroup();
139
220
let anotherGroup =db.getGroup(uuid);
140
221
let deepGroup =defaultGroup.groups[1].groups[2];
141
222
```
142
223
224
+
<br />
225
+
143
226
##### Group creation
144
227
```ts
145
228
let group =db.createGroup(db.getDefaultGroup(), 'New group');
146
229
let anotherGroup =db.createGroup(group, 'Subgroup');
147
230
```
148
231
232
+
<br />
233
+
149
234
##### Group deletion
150
235
```ts
151
236
db.remove(group);
152
237
```
153
238
239
+
<br />
240
+
154
241
##### Group move
155
242
```ts
156
243
db.move(group, toGroup);
157
244
db.move(group, toGroup, atIndex);
158
245
```
159
246
247
+
<br />
248
+
160
249
##### Recycle Bin
161
250
```ts
162
251
let recycleBin =db.getGroup(db.meta.recycleBinUuid);
@@ -165,25 +254,33 @@ if (!recycleBin) {
165
254
}
166
255
```
167
256
257
+
<br />
258
+
168
259
##### Recursive traverse
169
260
```ts
170
261
for (const entry ofgroup.allEntries()) { /* ... */ }
171
262
for (const group ofgroup.allGroups()) { /* ... */ }
172
263
for (const entryOrGroup ofgroup.allGroupsAndEntries()) { /* ... */ }
0 commit comments