cuffscript-wasm 3.5.0 → 3.5.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 CHANGED
@@ -38,7 +38,20 @@ into `mod.FS` (e.g. `mod.FS.mkdirTree("/project/lib")`,
38
38
  `mod.FS.writeFile("/project/lib/foo.cuff", "...")`) before calling `cuffRun`,
39
39
  then pass the entry file's directory as `scriptDir`.
40
40
 
41
- Full API surface: see `dist/cuffscript.d.ts`.
41
+ ## API
42
+
43
+ | Member | What it does |
44
+ | :--- | :--- |
45
+ | `mod.cuffRun(source, scriptDir)` | Parses and runs the program. `scriptDir` is the directory in the virtual file system that `use <name> from <path>` is resolved against. Returns `{ success, error }`; on failure `error` is the complete report, with the source line and a caret. |
46
+ | `mod.cuffDump(source)` | Parses without running and writes the token and syntax-tree dump through `print`. Returns `{ success, error }`. |
47
+ | `mod.FS` | Emscripten's virtual file system, for the files of a multi-file project. |
48
+
49
+ The module configuration takes `print` (called once per line a program prints), `printErr`, `stdin` (called once per byte that `input()` reads; return a byte from 0 to 255, or `null` at the end of the input) and `locateFile` (to fetch the `.wasm` file from somewhere else). Full types: `dist/cuffscript.d.ts`.
50
+
51
+ ## Limits of the browser build
52
+
53
+ The module runs a program with the engine's default options: no step or time budget, and every library enabled. A browser cannot make ordinary network connections, so `DLC:network` is not usable there. Memory is capped by the build flags in the repository's `Makefile`.
54
+ A page that runs code it did not write should run the module in a Web Worker that it can terminate. [Embedding the engine](https://github.com/cuffscript/cuffscript/blob/main/docs/guide/embedding.md#webassembly-and-npm) says more.
42
55
 
43
56
  ## Rebuilding
44
57
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cuffscript-wasm",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "Prebuilt WebAssembly build of the CuffScript language engine.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",