@kent-tokyo/chematic 1.0.14 → 1.0.15

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 CHANGED
@@ -4,7 +4,7 @@ WebAssembly bindings for [chematic](https://github.com/kent-tokyo/chematic), a p
4
4
 
5
5
  Published to npm as [`@kent-tokyo/chematic`](https://www.npmjs.com/package/@kent-tokyo/chematic).
6
6
 
7
- The current workspace line is 1.0.14. The binding keeps bounded parsing,
7
+ The current workspace line is 1.0.15. The binding keeps bounded parsing,
8
8
  typed failures, and opt-in `embed_pipeline_v2_json`; 3D/MMFF94 behavior remains
9
9
  Experimental and is not a claim of full RDKit parity.
10
10
 
@@ -95,6 +95,26 @@ console.log(tanimoto_atom_pair(mol, caffeine)); // AtomPair Tanimoto
95
95
  console.log(tanimoto_torsion(mol, caffeine)); // Torsion Tanimoto
96
96
  ```
97
97
 
98
+ ### Node.js
99
+
100
+ The published package is built with wasm-pack's `web` target. In a browser,
101
+ `await init()` locates the adjacent WASM asset. Node does not fetch `file:`
102
+ URLs, so pass the asset bytes explicitly:
103
+
104
+ ```js
105
+ import { readFile } from 'node:fs/promises';
106
+ import init, { parse_smiles } from '@kent-tokyo/chematic';
107
+
108
+ const wasm = await readFile(new URL(
109
+ './node_modules/@kent-tokyo/chematic/chematic_wasm_bg.wasm',
110
+ import.meta.url,
111
+ ));
112
+ await init({ module_or_path: wasm });
113
+ const mol = parse_smiles('c1ccccc1');
114
+ console.log(mol.formula()); // C6H6
115
+ mol.free();
116
+ ```
117
+
98
118
  ```js
99
119
  // Sprint Q: New descriptors (v0.1.15)
100
120
  console.log(mol.sa_score()); // synthetic accessibility [1,10]
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Kentaro Tanabe (kent-tokyo) <kent-tokyo@users.noreply.github.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
8
- "version": "1.0.14",
8
+ "version": "1.0.15",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",