diff --git a/README.md b/README.md index fc9001c..1031372 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,9 @@ bun install czv Or use `npm`, `pnpm`, or `yarn` instead of `bun`. -```js +The following example is written in TypeScript: + +```ts import init, * as czv from "czv"; // Must run `await init()` or `initSync()` first for web use await init(); @@ -53,7 +55,7 @@ apple,2.50 banana,3.00 strawberry,1.50`; -const output = czv.rowCount({ +const output: number = czv.rowCount({ file_data: data, include_header_row: true, }); diff --git a/czv-wasm/examples/basic-demo/README.md b/czv-wasm/examples/web-demo/README.md similarity index 63% rename from czv-wasm/examples/basic-demo/README.md rename to czv-wasm/examples/web-demo/README.md index 24d6a9e..7427c8e 100644 --- a/czv-wasm/examples/basic-demo/README.md +++ b/czv-wasm/examples/web-demo/README.md @@ -1 +1,7 @@ +# czv for WebAssembly web demo + +View `index.html` in a web browser and import a CSV file. + +## Development + If you want to modify the TypeScript code then after you save your modifications you must run `tsc script.ts --module es2022 --target es2022` to generate a compatible `script.js` file. diff --git a/czv-wasm/examples/basic-demo/index.html b/czv-wasm/examples/web-demo/index.html similarity index 100% rename from czv-wasm/examples/basic-demo/index.html rename to czv-wasm/examples/web-demo/index.html diff --git a/czv-wasm/examples/basic-demo/pico.min.css b/czv-wasm/examples/web-demo/pico.min.css similarity index 100% rename from czv-wasm/examples/basic-demo/pico.min.css rename to czv-wasm/examples/web-demo/pico.min.css diff --git a/czv-wasm/examples/basic-demo/script.js b/czv-wasm/examples/web-demo/script.js similarity index 100% rename from czv-wasm/examples/basic-demo/script.js rename to czv-wasm/examples/web-demo/script.js diff --git a/czv-wasm/examples/basic-demo/script.ts b/czv-wasm/examples/web-demo/script.ts similarity index 100% rename from czv-wasm/examples/basic-demo/script.ts rename to czv-wasm/examples/web-demo/script.ts diff --git a/czv-wasm/src/lib.rs b/czv-wasm/src/lib.rs index b7466d3..7e564bd 100644 --- a/czv-wasm/src/lib.rs +++ b/czv-wasm/src/lib.rs @@ -24,7 +24,7 @@ //! console.log(output); //! ``` //! -//! For a full website example see the example's source code here: https://www.npmjs.com/package/czv) +//! For a full website example see the example's source code here: https://www.npmjs.com/package/czv) //! //! # Links //!