npm_typed

Typed npm library bindings(40+) for js backend

js
npm
react
ai
ffi
moon add mizchi/npm_typed@0.1.15
Download zip
Author
Version
0.1.15
License
MIT
Last updated
last month
Downloads
16K

Dependencies

README

#mizchi/npm_typed

Typed npm package bindings for MoonBit, built on top of mizchi/js.

Inspired by DefinitelyTyped - the repository for high quality TypeScript type definitions. This project aims to be the MoonBit equivalent, providing type-safe FFI bindings for popular npm packages.

Note: These bindings require installing the corresponding npm packages.

# Example: Install React dependencies npm install react react-dom # Example: Install Hono npm install hono

#Installation

moon add mizchi/js moon add mizchi/npm_typed

Add to your moon.pkg.json:

{ "import": [ "mizchi/js", "mizchi/js/core", "mizchi/npm_typed/react", "mizchi/npm_typed/hono" ] }

#Available Packages

#UI Frameworks

PackagenpmStatusNote
reactreact๐Ÿงช TestedCore React API
react_element-๐Ÿงช TestedTyped HTML elements for React
react_domreact-dom๐Ÿงช TestedReact DOM
react_dom_clientreact-dom/client๐Ÿงช TestedClient-side rendering
react_dom_serverreact-dom/server๐Ÿงช TestedServer-side rendering
react_dom_staticreact-dom/static๐Ÿค– AI GeneratedStatic rendering
react_routerreact-router๐Ÿงช TestedClient-side routing
testing_library_react@testing-library/react๐Ÿงช TestedReact testing utilities
preactpreact๐Ÿงช TestedLightweight React alternative
testing_library_preact@testing-library/preact๐Ÿค– AI GeneratedPreact testing utilities
inkink๐Ÿงช TestedReact for CLI apps
ink_ui@inkjs/ui๐Ÿงช TestedInk UI components

#Web Frameworks

PackagenpmStatusNote
honohono๐Ÿงช TestedFast web framework, middleware support
better_authbetter-auth๐Ÿค– AI GeneratedAuthentication library
helmethelmet๐Ÿงช TestedSecurity headers middleware

#AI / LLM

PackagenpmStatusNote
aiai (Vercel AI SDK)๐Ÿงช TestedAI/LLM integration
modelcontextprotocol@modelcontextprotocol/sdk๐Ÿงช TestedMCP server/client
claude_code@anthropic-ai/claude-code๐Ÿค– AI GeneratedClaude Code SDK

#Cloud Services

PackagenpmStatusNote
client_s3@aws-sdk/client-s3๐Ÿงช TestedS3-compatible storage (AWS, GCS, R2, MinIO)

#Database

PackagenpmStatusNote
pglite@electric-sql/pglite๐Ÿงช TestedEmbedded PostgreSQL
duckdb@duckdb/duckdb-wasm๐Ÿค– AI GeneratedAnalytical database
drizzledrizzle-orm๐Ÿค– AI GeneratedTypeScript ORM (see limitations)
pgpg๐Ÿค– AI GeneratedPostgreSQL client

#Validation / Schema

PackagenpmStatusNote
zodzod๐Ÿงช TestedSchema validation
ajvajv๐Ÿงช TestedJSON Schema validator

#Build Tools

PackagenpmStatusNote
terserterser๐Ÿงช TestedJavaScript minifier
vitevite๐Ÿงช TestedNext-gen build tool
unpluginunplugin๐Ÿค– AI GeneratedUnified plugin system
lighthouselighthouse๐Ÿค– AI GeneratedWeb performance auditing
esbuildesbuild๐Ÿงช TestedFast bundler
oxc_minifyoxc-minify๐Ÿงช TestedOxc minifier

#Utilities

PackagenpmStatusNote
date_fnsdate-fns๐Ÿงช TestedDate manipulation
semversemver๐Ÿงช TestedSemantic versioning
chalkchalk๐Ÿงช TestedTerminal styling
colorettecolorette๐Ÿงช TestedTerminal colors
dotenvdotenv๐Ÿงช TestedEnvironment variables
chokidarchokidar๐Ÿงช TestedFile watching
yargsyargs๐Ÿค– AI GeneratedCLI argument parsing
debugdebug๐Ÿค– AI GeneratedDebug logging
josejose๐Ÿงช TestedJWT/JWE/JWS
comlinkcomlink๐Ÿค– AI GeneratedWeb Worker RPC
simple_gitsimple-git๐Ÿค– AI GeneratedGit operations
ignoreignore๐Ÿค– AI Generated.gitignore parsing
memfsmemfs๐Ÿงช TestedIn-memory file system
minimatchminimatch๐Ÿงช TestedGlob matching
execaexeca๐Ÿงช TestedProcess execution
pinopino๐Ÿงช TestedFast logging
magic_stringmagic-string๐Ÿงช TestedString manipulation

#Testing / Development

PackagenpmStatusNote
vitestvitest๐Ÿšง PartialTest runner
puppeteerpuppeteer๐Ÿงช TestedBrowser automation
playwrightplaywright๐Ÿงช TestedBrowser automation
playwright_test@playwright/test๐Ÿค– AI GeneratedPlaywright test framework
jsdomjsdom๐Ÿงช TestedDOM implementation
happy_domhappy-dom๐Ÿงช TestedFast DOM implementation
global_jsdomglobal-jsdom๐Ÿงช TestedJSDOM for testing
testing_library@testing-library/dom๐Ÿงช TestedDOM testing utilities
mswmsw๐Ÿงช TestedMock Service Worker
ink_testing_libraryink-testing-library๐Ÿงช TestedInk testing utilities

#Parsing

PackagenpmStatusNote
htmlparser2htmlparser2๐Ÿงช TestedHTML/XML parser
js_yamljs-yaml๐Ÿค– AI GeneratedYAML parser
source_mapsource-map๐Ÿงช TestedSource map utilities
error_stack_parsererror-stack-parser๐Ÿงช TestedStack trace parsing

#Status Legend

  • ๐Ÿงช Tested: Comprehensive test coverage
  • ๐Ÿšง Partial: Core functionality implemented
  • ๐Ÿค– AI Generated: Needs testing

#Can't find your library?

You can easily add new bindings with AI assistance:

./_scripts/new-library.sh <package_name>

See CONTRIBUTING.md for details. Most bindings in this repository were generated with AI agents.

#Quick Start

#React Example

// moon.pkg.json: import mizchi/npm_typed/react, mizchi/npm_typed/react_element

fn counter(_props : Unit) -> @react.Element {
let (count, set_count) = @react.useState(0)
@react_element.div([
@react_element.span(["Count: \{count}"]),
@react_element.button(on_click=fn(_) { set_count(count + 1) }, ["+"]),
])
}

#Hono Example

// moon.pkg.json: import mizchi/npm_typed/hono

async fn main {
let app : @hono.Hono[@core.Any, @core.Any] = @hono.Hono::new()
app.get("/", fn(c) { c.text("Hello, Hono!") }) |> ignore
}

#Zod Example

// moon.pkg.json: import mizchi/npm_typed/zod

fn main {
let user_schema = @zod.object({
"name": @zod.string(),
"age": @zod.number().int(),
})
let data = @core.new_object()
data["name"] = @core.any("Alice")
data["age"] = @core.any(30)
match user_schema.safeParse(data) {
Ok(_) => println("Valid!")
Err(_) => println("Invalid!")
}
}

#Requirements

This package requires:

  • MoonBit nightly 2025-12-09 or later for ESM #module directive support
  • mizchi/js v0.9.0 or later as a peer dependency

#LICENSE

MIT

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

ยฉ 2026 mooncakes.io