mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 22:55:59 +00:00
16 lines
387 B
JavaScript
16 lines
387 B
JavaScript
const fs = require('fs-extra');
|
|
|
|
async function saveFreeTableData(file, data) {
|
|
const { structure, rows } = data;
|
|
const fileStream = fs.createWriteStream(file);
|
|
await fileStream.write(JSON.stringify(structure) + '\n');
|
|
for (const row of rows) {
|
|
await fileStream.write(JSON.stringify(row) + '\n');
|
|
}
|
|
await fileStream.close();
|
|
}
|
|
|
|
module.exports = {
|
|
saveFreeTableData,
|
|
};
|