New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bun-sqlite-key-value

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-sqlite-key-value - npm Package Compare versions

Comparing version 1.3.5 to 1.3.6

assets/bun.png

17

examples/getItemsObjectExample.ts

@@ -9,5 +9,6 @@ import { BunSqliteKeyValue } from "../src"

store.set("language:it", "Italian")
store.set("my-null-value", null)
const items = store.getItemsObject("language:")
console.log(items)
const items1 = store.getItemsObject("language:")
console.log(items1)
// -> {

@@ -18,1 +19,13 @@ // "language:de": "German",

// }
const items2 = store.getItemsObject([
"language:de",
"my-null-value",
"my-unknown-key"
])
console.log(items2)
// -> {
// "language:de": "German",
// "my-null-value": null,
// "unknown-key": undefined,
// }

2

package.json
{
"name": "bun-sqlite-key-value",
"description": "A super fast key-value store with SQLite that uses bun:sqlite and v8 as faster JSON replacement.",
"version": "1.3.5",
"version": "1.3.6",
"author": "Gerold Penz<gerold@gp-softwaretechnik.at>",

@@ -6,0 +6,0 @@ "module": "src/index.ts",

@@ -298,1 +298,27 @@ # Bun SQLite Key Value

```
### Read and write binary files
SQLite has no problem with large images/binaries.
#### Example
```typescript
import { BunSqliteKeyValue } from "bun-sqlite-key-value"
const store = new BunSqliteKeyValue()
// Read file from filesystem
const sourceFile = Bun.file("<Source File Path>")
// Write ArrayBuffer into database (async !!!)
store.set("my-image", await sourceFile.arrayBuffer())
// Read ArrayBuffer from database
const targetArrayBuffer = store.get("my-image")
// Write target file to filesystem (async !!!)
await Bun.write(Bun.file("<Target File Path>"), targetArrayBuffer)
```

@@ -7,2 +7,3 @@ import { expect, test } from "bun:test"

const KEY_2: string = "test-key-2"
const KEY_3: string = "test-key-3"
const STRING_VALUE_1: string = "Hello world!"

@@ -242,1 +243,22 @@ const STRING_VALUE_2: string = "Hello moon!"

})
test("Get items as Object", () => {
const store: BunSqliteKeyValue = new BunSqliteKeyValue()
store.set<string>(KEY_1, STRING_VALUE_1)
store.set<string>(KEY_2, STRING_VALUE_2)
store.set(KEY_3, null)
expect(store.getItemsObject([
KEY_1,
KEY_2,
KEY_3,
"unknown-key"
])).toEqual({
[KEY_1]: STRING_VALUE_1,
[KEY_2]: STRING_VALUE_2,
[KEY_3]: null,
"unknown-key": undefined
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc