web-sqlite-js 0.0.7 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/dist/index.js +23 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<h1 align="center">web-sqlite-js</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://web-sqlite-js.wuchuheng.com" target="_blank">
|
|
5
|
+
<img src="docs/public/web-sqlite-js.gif" width="80%" style="border-radius: 10px;" />
|
|
6
|
+
</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/wuchuheng/web-sqlite-js/actions/workflows/test.yml" target="_blank">
|
|
11
|
+
<img src="https://github.com/wuchuheng/web-sqlite-js/actions/workflows/test.yml/badge.svg" alt="Test" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/web-sqlite-js" target="_blank">
|
|
14
|
+
<img src="https://img.shields.io/npm/v/web-sqlite-js.svg" alt="NPM Version" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://github.com/wuchuheng/web-sqlite-js/blob/main/LICENSE" target="_blank">
|
|
17
|
+
<img src="https://img.shields.io/github/license/wuchuheng/web-sqlite-js.svg" alt="License" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://bundlephobia.com/package/web-sqlite-js" target="_blank">
|
|
20
|
+
<img src="https://img.shields.io/bundlephobia/minzip/web-sqlite-js.svg" alt="Bundle Size" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://github.com/wuchuheng/web-sqlite-js/pulls" target="_blank">
|
|
23
|
+
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" />
|
|
24
|
+
</a>
|
|
3
25
|
</p>
|
|
4
26
|
|
|
5
27
|
`web-sqlite-js` is a friendly, out-of-the-box SQLite database for the web that makes persistent client-side storage simple for every developer.
|
|
@@ -43,7 +65,7 @@ For quick demos or plain HTML pages you can load the prebuilt module directly:
|
|
|
43
65
|
|
|
44
66
|
```html
|
|
45
67
|
<script type="module">
|
|
46
|
-
import openDB from "https://cdn.jsdelivr.net/npm/web-sqlite-js@0.0
|
|
68
|
+
import openDB from "https://cdn.jsdelivr.net/npm/web-sqlite-js@1.0.0/dist/index.js";
|
|
47
69
|
// ...
|
|
48
70
|
</script>
|
|
49
71
|
```
|
package/dist/index.js
CHANGED
|
@@ -699,7 +699,27 @@ const U = () => {
|
|
|
699
699
|
return A = Q.catch(() => {
|
|
700
700
|
}), Q;
|
|
701
701
|
};
|
|
702
|
-
}, h =
|
|
702
|
+
}, h = "https://web-sqlite-js.wuchuheng.com", y = `${h}/getting-started.html#setup-http-headers`;
|
|
703
|
+
function c() {
|
|
704
|
+
try {
|
|
705
|
+
new SharedArrayBuffer();
|
|
706
|
+
} catch {
|
|
707
|
+
throw new Error(`
|
|
708
|
+
[web-sqlite-js] SharedArrayBuffer is not enabled.
|
|
709
|
+
|
|
710
|
+
This library requires SharedArrayBuffer for high-performance database operations.
|
|
711
|
+
To enable it, your server must send the following HTTP headers:
|
|
712
|
+
|
|
713
|
+
Cross-Origin-Opener-Policy: same-origin
|
|
714
|
+
Cross-Origin-Embedder-Policy: require-corp
|
|
715
|
+
|
|
716
|
+
For configuration guides (Vite, Next.js, Nginx, etc.), visit:
|
|
717
|
+
${y}
|
|
718
|
+
`);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
const e = async (A, g) => {
|
|
722
|
+
c();
|
|
703
723
|
const { sendMsg: Q } = U(), o = N();
|
|
704
724
|
await Q(F.OPEN, { filename: A, options: g });
|
|
705
725
|
const E = async (I, B) => await Q(F.EXECUTE, {
|
|
@@ -734,6 +754,6 @@ const U = () => {
|
|
|
734
754
|
};
|
|
735
755
|
};
|
|
736
756
|
export {
|
|
737
|
-
|
|
738
|
-
|
|
757
|
+
e as default,
|
|
758
|
+
e as openDB
|
|
739
759
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-sqlite-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "web-sqlite-js is a friendly, out-of-the-box SQLite database for the web that makes persistent client-side storage simple for every developer.",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"docs"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"test": "npm run build && npm run lint && npm run test:unit && npm run test:e2e ",
|
|
30
30
|
"test:unit": "vitest run --config vitest.unit.config.ts --coverage",
|
|
31
|
-
"http": "tsx scripts/http-service.ts ./
|
|
31
|
+
"http": "tsx scripts/http-service.ts ./ --port 8399",
|
|
32
32
|
"http:docs": "tsx scripts/http-service.ts ./docs/.vitepress/dist --port 8399",
|
|
33
33
|
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
34
34
|
"test:debug": "vitest run --config vitest.e2e.config.ts --no-file-parallelism",
|