mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-24 03:34:18 +01:00
simplify setup by emiting index.js in ESM style from napi
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
// @ts-nocheck
|
||||
/* auto-generated by NAPI-RS */
|
||||
|
||||
const { createRequire } = require('node:module')
|
||||
require = createRequire(__filename)
|
||||
import { createRequire } from 'node:module'
|
||||
const require = createRequire(import.meta.url)
|
||||
const __dirname = new URL('.', import.meta.url).pathname
|
||||
|
||||
const { readFileSync } = require('node:fs')
|
||||
let nativeBinding = null
|
||||
@@ -392,6 +393,6 @@ if (!nativeBinding) {
|
||||
throw new Error(`Failed to load native binding`)
|
||||
}
|
||||
|
||||
module.exports = nativeBinding
|
||||
module.exports.Database = nativeBinding.Database
|
||||
module.exports.Statement = nativeBinding.Statement
|
||||
const { Database, Statement } = nativeBinding
|
||||
export { Database }
|
||||
export { Statement }
|
||||
|
||||
Reference in New Issue
Block a user