11 lines
361 B
JavaScript
11 lines
361 B
JavaScript
|
const sqlite = require("better-sqlite3");
|
||
|
const db = new sqlite('the_big_db.db', { verbose: console.log });
|
||
|
|
||
|
const fs = require('node:fs');
|
||
|
|
||
|
const dump = {
|
||
|
pages: db.prepare('select * from pages').all(),
|
||
|
users: db.prepare('select * from users').all()
|
||
|
};
|
||
|
|
||
|
fs.writeFile(`dump_${new Date().toISOString()}.json`, JSON.stringify(dump), (err) => console.log(err) );
|