Socket
Book a DemoInstallSign in
Socket

@mlc-ai/web-xgrammar

Package Overview
Dependencies
Maintainers
6
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mlc-ai/web-xgrammar

This folder contains the source code and emcc bindings for compiling XGrammar to Javascript/Typescript via [emscripten](https://emscripten.org/).

0.1.0
latest
Source
npmnpm
Version published
Maintainers
6
Created
Source

web-xgrammar

This folder contains the source code and emcc bindings for compiling XGrammar to Javascript/Typescript via emscripten.

Build from source

  • Install emscripten. It is an LLVM-based compiler that compiles C/C++ source code to WebAssembly.

    • Follow the installation instruction to install the latest emsdk.
    • Source emsdk_env.sh by source /path/to/emsdk_env.sh, so that emcc is reachable from PATH and the command emcc works.
    • We can verify the successful installation by trying out emcc in the terminal.
  • Modify the content of cmake/config.cmake to be web/config.cmake.

  • Run the following

    source /path/to/emsdk_env.sh
    npm install
    npm run build
    

Example

To try out the test webpage, run the following

cd example
npm install
npm start

Testing

For testing in node environment, run:

npm test

Keywords

machine_learning

FAQs

Package last updated on 22 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.