A persistent IndexedDB store for PyScript (#2101)

A persistent IndexedDB store for PyScript
This commit is contained in:
Andrea Giammarchi
2024-06-19 14:11:57 +02:00
committed by GitHub
parent aab015b9b8
commit d0406be84c
9 changed files with 489 additions and 167 deletions

View File

@@ -0,0 +1,17 @@
const { writeFileSync, readFileSync } = require("node:fs");
const { join } = require("node:path");
const flatted = "# https://www.npmjs.com/package/flatted\n\n";
const source = join(
__dirname,
"..",
"node_modules",
"flatted",
"python",
"flatted.py",
);
const dest = join(__dirname, "..", "src", "stdlib", "pyscript", "flatted.py");
const clear = (str) => String(str).replace(/^#.*/gm, "").trimStart();
writeFileSync(dest, flatted + clear(readFileSync(source)));