chemicaljs 1.2.4 → 1.3.0

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.
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "homepage": "https://github.com/chemicaljs/chemical#readme",
20
20
  "dependencies": {
21
- "chemicaljs": "^1.0.1",
21
+ "chemicaljs": "^1.2.5",
22
22
  "express": "^4.19.2"
23
23
  }
24
24
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  search.addEventListener("keydown", async function (e) {
9
9
  if (e.key == "Enter" && window.chemicalLoaded && e.target.value) {
10
- window.location = await window.chemicalEncode(e.target.value, "rammerhead")
10
+ window.location = await window.chemicalEncode(e.target.value)
11
11
  }
12
12
  })
13
13
  </script>
@@ -0,0 +1,9 @@
1
+ # Chemical Example Vite
2
+
3
+ Note: This example uses Preact but any framework will work.
4
+
5
+ Run `npm install` to install dependencies.
6
+
7
+ Run `npm run build` to build and `npm start` to start.
8
+
9
+ Run `npm run dev` to start the dev server which is the point of this example.
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <script src="/chemical.js"></script>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.jsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,14 @@
1
+ import { ChemicalServer } from "chemicaljs";
2
+ import express from "express";
3
+
4
+ const chemical = new ChemicalServer();
5
+ const port = process.env.PORT || 3000;
6
+
7
+ chemical.app.use(express.static("dist", {
8
+ index: "index.html",
9
+ extensions: ["html"]
10
+ }));
11
+
12
+ chemical.server.listen(port, () => {
13
+ console.log(`Chemical example vite listening on port ${port}`);
14
+ });