Skip to content

Instantly share code, notes, and snippets.

View mihaerzen's full-sized avatar
👋
Hi, nice to meet you!

Miha Eržen mihaerzen

👋
Hi, nice to meet you!
View GitHub Profile
@mihaerzen
mihaerzen / SqliteReadable.ts
Last active October 17, 2023 15:31
sqlite3 readable stream
import sqlite, { Statement } from 'sqlite3'
import { Readable, ReadableOptions } from 'stream'
interface Props extends ReadableOptions {
dbPath: string
query: string
}
export class SqliteReadable extends Readable {
private stmt: Statement
/*
* This script shows COVID-19 numbers using sledilnik.org API.
* No guarantee on correctness and completeness of the information provided.
*/
const BASE_API_URL = "https://api.sledilnik.org/api";
// URL to open when pressing on the widget.
const WIDGET_PRESS_URL = "https://covid-19.sledilnik.org";