永井 忠一 2024.10.17
インストール
| Linux apt |
|---|
|
(確認は「$ systemctl status memcached」)
接続テスト
| Perl | Python | |
|---|---|---|
| set | |
|
| get | |
|
| delete | |
|
(100% Python(Pure Python) interface のため、PyPy でも実行可能)
Node.js から利用。インストール
| Linux apt, npm |
|---|
|
(備忘録)
$ cat package.json { "type": "module", "dependencies": { "@deno/kv": "^0.12.0" } }
テストコード
| JavaScript |
|---|
import { openKv } from "@deno/kv";
const cache = await openKv(/* "test.db" */);
await cache.set(["test-key"], "test record");
// console.time()
const result = await cache.get(["test-key"]);
// console.timeEnd()
if (result.value !== null) {
console.log(result.value);
}
await cache.delete(["test-key"]);
|
注意!
CAUTION
Deno KV is still in development and may change. ...snip...
© 2024 Tadakazu Nagai