Skip to content

Commit

Permalink
Update lib.js
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking authored Sep 23, 2024
1 parent 7259aa6 commit 30e700f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Database } from "bun:sqlite";
import * as fs from 'node:fs/promises';

var db = (sdb) => {
return {
Expand Down Expand Up @@ -53,7 +54,16 @@ var db = (sdb) => {
};

export default {


file_exists: async function(s) {
try {
await fs.access(s, fs.constants.F_OK)
return true
} catch {
return false
}
},

sqlite: function(path, options) {
if (options) options = {}
var s = new Database(path, {
Expand Down

0 comments on commit 30e700f

Please sign in to comment.