-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make a separate README for node module
- Loading branch information
Showing
4 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Pomsky WASM module for node | ||
|
||
WASM module of [Pomsky](https://pomsky-lang.org). | ||
|
||
## Usage | ||
|
||
```js | ||
import { compile } from '@pomsky-lang/compiler-web' | ||
|
||
const { output, diagnostics } = compile(`^ C* '.' C* $`, 'js') | ||
``` | ||
|
||
This _should_ just work in Node.js. To use Pomsky in the browser, use [unplugin](https://www.npmjs.com/package/@pomsky-lang/unplugin) if you're using a bundler, or [compiler-web](https://www.npmjs.com/package/@pomsky-lang/compiler-web) if you want to compile Pomsky expressions on the client. | ||
|
||
Don't forget to check if `output === null`, which means that compilation failed, and you have to look at the diagnostics. Even when the expression compiled successfully, `diagnostics` may contain useful warnings. | ||
|
||
## License | ||
|
||
Dual-licensed under the [MIT license][mit-license] or the [Apache 2.0 license][apache-2-license]. | ||
|
||
[mit-license]: https://opensource.org/licenses/MIT | ||
[apache-2-license]: https://opensource.org/licenses/Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters