npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ufjs/webgl

v0.1.4

Published

WebGL contexts for fjs canvas — getContext('webgl'/'webgl2') on the app via ANGLE, browser-native on the web

Readme

@ufjs/webgl

给 fjs 的 <canvas> 补上 WebGL:getContext('webgl' / 'webgl2')。App 端经 ANGLE 渲染进 Flutter,web 端直接用浏览器原生的 context,three.js / PixiJS / LeaferJS 这类库不需要改动就能两端跑。

仓库里的 examples/racing(three.js 赛车)和 examples/hello-fjs(three.js 跳一跳、PixiJS 消消乐等)就是这么用它的。

使用者要做的事

npm i @ufjs/webgl

包里的 "fjs": { "module": true } 会触发 fjs 的 autolink:Flutter 宿主的 依赖和 FjsWebgl.register(engine) 注册调用自动生效,不需要手工配置。

const canvas = document.createElement('canvas')
const gl = canvas.getContext('webgl')

调用的是这套包导出的 FjsWebGLRenderingContext:接口形状照 WebGL 1.0/2.0 裁剪,命令编码成 op 协议帧发给宿主,宿主经 ANGLE 上屏。不支持的调用会 console.warn 指明是哪一条,而不是静默吞掉。

平台说明

  • App(Flutter):ANGLE 依赖在宿主侧,最低 Flutter 3.38(Dart 3.10), 见 flutter_fjs 的 CHANGELOG。鸿蒙走 flutter/ohos 里的 EGL 后端。
  • Web:直接返回浏览器原生 WebGLRenderingContext,本包只做类型对齐。
  • 小程序:经 fjs build --mp 的 canvas 桥接走 wx 的 WebGL 上下文。