@amnesia-js/core
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

Amnesia JS

AmnesiaDB Official Client

Example

Connect to locally hosted Amnesia DB

import { AmnesiaClient } from 'amnesia-client';

const am = new AmnesiaClient();
await am.connect({ port: 4224 });

Run a Query

let res = await am.query('SET a AS b WHERE TTL=10s NFETCH=2');
console.log(res) // OK

Alternatively

let res = await am.get('key');  // null
await am.set('key', 'value', { ttl: '20s', nfetch: 2 });
let res = await am.get('key');  // value

Package Sidebar

Install

npm i @amnesia-js/core

Weekly Downloads

3

Version

1.2.3

License

AGPL-3.0-or-later

Unpacked Size

55.3 kB

Total Files

10

Last publish

Collaborators

  • nikhilcodes