Initializes the WebAssembly parser from bytes or a compiled module without fetching it. Call this before any parser function; prefer init when the binary should be loaded asynchronously.
import { readFile } from 'node:fs/promises'import { initSync, parse } from '@retorquere/bibtex-parser'initSync({ module: await readFile('bibtex_parser_bg.wasm') })const library = parse('@article{example, title={A title}}') Copy
import { readFile } from 'node:fs/promises'import { initSync, parse } from '@retorquere/bibtex-parser'initSync({ module: await readFile('bibtex_parser_bg.wasm') })const library = parse('@article{example, title={A title}}')
Instantiates the given module, which can either be bytes or a precompiled WebAssembly.Module.
module
WebAssembly.Module
Passing SyncInitInput directly is deprecated.
SyncInitInput
Initializes the WebAssembly parser from bytes or a compiled module without fetching it. Call this before any parser function; prefer init when the binary should be loaded asynchronously.
Example