This package has been deprecated

Author message:

The package has been moved to @pomsky-lang/compiler-web.

pomsky-wasm
TypeScript icon, indicating that this package has built-in type declarations

0.9.2 • Public • Published

pomsky-wasm

Node.js/WASM module of pomsky.

Usage

import { compile } from 'pomsky-wasm'

const { output, diagnostics } = compile(`^ C* '.' C* $`, 'js')

If this doesn't work with your bundler, try initializing the module explicitly:

import init, { compile } from 'pomsky-wasm'

await init()
const { output, diagnostics } = compile(`^ C* '.' C* $`, 'js')

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.

With vite

If you're using vite, you also need to update your vite config like this:

  import { defineConfig } from 'vite'

  export default defineConfig(({ mode }) => ({
+   optimizeDeps: {
+     exclude: mode === 'production' ? [] : ['pomsky-wasm'],
+   },
  }))

License

Dual-licensed under the MIT license or the Apache 2.0 license.

Readme

Keywords

none

Package Sidebar

Install

npm i pomsky-wasm

Weekly Downloads

183

Version

0.9.2

License

MIT OR Apache-2.0

Unpacked Size

205 kB

Total Files

11

Last publish

Collaborators

  • aloso