Skip to content

Commit aab2420

Browse files
committed
feat: migrate import/export to @deno/kv-utils
1 parent 03836f6 commit aab2420

File tree

5 files changed

+26
-885
lines changed

5 files changed

+26
-885
lines changed

README.md

+5-29
Original file line numberDiff line numberDiff line change
@@ -200,35 +200,11 @@ alternative
200200

201201
## NDJSON
202202

203-
New line delimitated JSON ([NDJSON](https://github.com/ndjson/ndjson-spec)) is a
204-
standard for supporting JSON string encoding of data where each record of data
205-
is delimitated by a new line. This particular format is the most straight-
206-
forward way of supporting JSON encoding and streaming.
207-
208-
The toolbox includes the capabilities to export entries from a KV store to
209-
NDJSON, transform a byte stream of NDJSON into individual JSON KV entry
210-
representations, and be able to import KV entries from NDJSON encoded data.
211-
212-
### `exportEntries()`
213-
214-
Like `Deno.Kv.prototype.list()`, but entries are returned as a stream of bytes
215-
or strings encoded as NDJSON.
216-
217-
### `exportToResponse()`
218-
219-
Like `Deno.Kv.prototype.list()`, but a `Response` is returned with the selected
220-
entries encoded as NDJSON as the body of the response, suitable for sending to a
221-
client as a response to a query.
222-
223-
### `LineTransformStream()`
224-
225-
A transform stream which takes a byte stream, like from a `Request` body, of
226-
NDJSON encoded entry data and transforms it into individual chunks of JSON
227-
strings which can be used with `JSON.parse()`.
228-
229-
### `importEntries()`
230-
231-
Takes NDJSON encoded data and imports it into a Deno KV store.
203+
> [!IMPORTANT]
204+
> The ability to import and export NDJSON has been contributed to
205+
> [@deno/kv-utils](https://jsr.io/@deno/kv-utils/) and will be maintained there.
206+
> The toolbox includes this capability, but this package does not contain the
207+
> utilities anymore.
232208
233209
## Keys
234210

deno.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"./batched_atomic": "./batched_atomic.ts",
77
"./blob": "./blob.ts",
88
"./crypto": "./crypto.ts",
9-
"./keys": "./keys.ts",
10-
"./ndjson": "./ndjson.ts"
9+
"./keys": "./keys.ts"
1110
},
1211
"publish": {
1312
"exclude": [
@@ -27,7 +26,7 @@
2726
},
2827
"lock": false,
2928
"imports": {
30-
"@deno/kv-utils": "jsr:@deno/kv-utils@^0.1.1",
29+
"@deno/kv-utils": "jsr:@deno/kv-utils@^0.1.2",
3130
"@std/bytes": "jsr:@std/bytes@~1"
3231
}
3332
}

ndjson.test.ts

-322
This file was deleted.

0 commit comments

Comments
 (0)