Queue for use with deta base.
npm install deta-queue
import { Queue } from 'deta-queue';
import { Deta } from 'deta';
// Initialize with a Project Key
const deta = Deta(process.env.DETA_PROJECT_KEY);
const queue = new Queue(deta);
async function main() {
await queue.empty();
const items = ["test1", "test2", "test3", "test4", "test5"]
for (let index = 0; index < items.length; index++) {
const element = items[index];
await queue.push(element);
}
const item = queue.pop(1);
console.log(item);
}
main();
//=> 'test1'
Type: object
Deta object
Type: number
expireIn for the Deta Base Item
Type: string
Default: queue
Base Name for the Queue Deta Bases