@spglib/moyo-wasm 0.11.0 → 0.12.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.
- package/README.md +24 -26
- package/moyo_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# moyo-wasm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@spglib/moyo-wasm)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
JavaScript and WebAssembly interface of [moyo](https://github.com/spglib/moyo), a fast and robust crystal symmetry finder.
|
|
6
|
+
|
|
7
|
+
- npm: <https://www.npmjs.com/package/@spglib/moyo-wasm>
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
## Installation
|
|
8
10
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
# or from cloned repo during development
|
|
12
|
-
|
|
11
|
+
```shell
|
|
12
|
+
npm install @spglib/moyo-wasm
|
|
13
|
+
# or from a cloned repo during development
|
|
14
|
+
npm install file:/path/to/moyo/moyo-wasm/pkg
|
|
13
15
|
```
|
|
14
16
|
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
15
19
|
Initialize and analyze a structure:
|
|
16
20
|
|
|
17
21
|
```ts
|
|
18
|
-
import init, { analyze_cell, type MoyoDataset, type MoyoCell } from 'moyo-wasm'
|
|
19
|
-
import wasm_url from 'moyo-wasm/moyo_wasm_bg.wasm?url'
|
|
22
|
+
import init, { analyze_cell, type MoyoDataset, type MoyoCell } from '@spglib/moyo-wasm'
|
|
23
|
+
import wasm_url from '@spglib/moyo-wasm/moyo_wasm_bg.wasm?url'
|
|
20
24
|
|
|
21
25
|
await init(wasm_url)
|
|
22
26
|
|
|
@@ -36,24 +40,18 @@ console.log(`Wyckoffs: ${result.wyckoffs.join(', ')}`)
|
|
|
36
40
|
|
|
37
41
|
The package exports TypeScript types generated from Rust (e.g. `MoyoDataset`).
|
|
38
42
|
|
|
39
|
-
##
|
|
43
|
+
## Development
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
wasm-pack build moyo-wasm --target web --release
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
The package code ready for publishing is in `moyo-wasm/pkg`.
|
|
45
|
+
Run from the repo root with `just` (or the equivalent npm commands from this directory):
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
# Install dependencies
|
|
52
|
-
npm install
|
|
53
|
-
# Run tests
|
|
54
|
-
npm test
|
|
47
|
+
```shell
|
|
48
|
+
just js-install # npm install
|
|
49
|
+
just js-build # wasm-pack build --target web --release --scope spglib
|
|
50
|
+
just js-test # npm test
|
|
55
51
|
```
|
|
56
52
|
|
|
57
|
-
|
|
53
|
+
The package code ready for publishing is generated in `moyo-wasm/pkg`. It is published to npm by CI when a new git tag is pushed to the monorepo.
|
|
54
|
+
|
|
55
|
+
## How to cite moyo-wasm
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
See the citation information in [the root README](https://github.com/spglib/moyo/blob/main/README.md)
|
package/moyo_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED