Added database wrapper
All checks were successful
Build / Build NPM Project (push) Successful in 1m7s
Build / Tag Version (push) Successful in 14s
Build / Publish Documentation (push) Successful in 53s

This commit is contained in:
2025-05-25 23:02:56 -04:00
parent 97f2bcce2e
commit 6d706d4c15
7 changed files with 126 additions and 138 deletions

View File

@ -1,15 +1,29 @@
<html>
<body>
<script type="module">
import {Cache, Collection} from './dist/index.mjs';
import {Cache, Database} from './dist/index.mjs';
const db = new Database('test', ['test', 'test2', 'test3']);
const cache = new Cache('id', {
ttl: 60,
storage: new Collection('test', 'test'),
storage: db.table('test'),
expiryPolicy: 'delete'
});
cache.add({id: 1, name: 'zak', age: 27});
const cache2 = new Cache('id', {
ttl: 60,
storage: db.table('test2'),
expiryPolicy: 'delete'
});
const cache3 = new Cache('id', {
ttl: 60,
storage: db.table('test3'),
expiryPolicy: 'delete'
});
console.log(cache3.all());
</script>
</body>
</html>