Skip to content

Commit 4b5ba35

Browse files
authored
feat: support recording timestamps (#413)
1 parent ac3f1b9 commit 4b5ba35

File tree

7 files changed

+2587
-797
lines changed

7 files changed

+2587
-797
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Simple JSONL-based key-value store. Uses an append-only file to store the data.
44

55
![Build Status](https://action-badges.now.sh/AlCalzone/jsonl-db)
66
<!-- [![Coverage Status](https://img.shields.io/coveralls/github/AlCalzone/jsonl-db.svg)](https://coveralls.io/github/AlCalzone/jsonl-db) -->
7-
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/AlCalzone/jsonl-db.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/AlCalzone/jsonl-db/context:javascript)
87
[![node](https://img.shields.io/node/v/@alcalzone/jsonl-db.svg) ![npm](https://img.shields.io/npm/v/@alcalzone/jsonl-db.svg)](https://www.npmjs.com/package/@alcalzone/jsonl-db)
98

109

@@ -127,6 +126,10 @@ The following options exist (all optional) and can be combined:
127126
| `onClose` | `false` | Compress when closing the DB |
128127
| `onOpen` | `false` | Compress after opening the DB |
129128

129+
### Keeping track of timestamps
130+
131+
The DB can automatically keep track of the last time a key was accessed or modified. To do so, set the `enableTimestamps` option to `true`. Every `set` call will update the timestamp of a value, which can be retrieved using `getTimestamp(key)`.
132+
130133
### Import / Export
131134

132135
Importing JSON files can be done this way:

0 commit comments

Comments
 (0)