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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sruim/mesh-flow

v0.0.3

Published

浏览器端 3D 模型格式转换 SDK(Assimp WASM 封装),支持 OBJ/FBX/USDZ/STL/GLB/3MF/PLY/VOX/GLTF 输入与 GLB/OBJ/STL/PLY/USDZ/FBX 导出

Readme

mesh flow

浏览器端 3D 模型格式转换 SDK,基于 AssimpJS 的 WASM 封装。提供统一的 API 与资源路径约定,在前端即可完成常见 3D 格式的互转。

功能特性

  • 支持在浏览器中进行模型格式转换,无需后端服务
  • 统一的 /wasm/* 资源路径,简化部署与预览
  • 提供轻量 API:createAssimp()convert(input, target, options?)
  • 类型完备的 TypeScript 支持

支持格式

  • 输入:OBJFBXUSDZSTLGLB3MFPLYVOXGLTF
  • 输出:GLBOBJSTLPLYUSDZFBX
  • 规则:当目标为 usd 时,实际导出为 usdz

安装

pnpm add @sruim/mesh-flow
# 或者
npm i @sruim/mesh-flow

快速开始

import { createAssimp, convert } from '@sruim/mesh-flow';

await createAssimp();

const file = new File([], 'model.obj');
const res = await convert(file, 'glb', { name: 'model' });

const blob = new Blob([res]);
const url = URL.createObjectURL(blob);

API

  • createAssimp(): Promise<Assimp>
    • 预加载导入器与导出器模块,保证后续转换快速稳定
  • convert(input, target, options?): Promise<Uint8Array>
    • input 支持:string URLFileBlobArrayBufferUint8Array{ name, data }{ files: { name, data }[] }
    • targetglb | obj | stl | ply | usd | fbx(其中 usd 会映射为 usdz
    • options{ embedTextures?: boolean; binary?: boolean; name?: string }

WASM 资源部署

  • 运行时会从站点根路径请求 /wasm/* 资源:
    • assimpjs-all.js
    • assimpjs-all.wasm
    • assimpjs-exporter.js
    • assimpjs-exporter.wasm
  • 开发环境:将上述文件放入 public/wasm/(Vite 会以 /wasm/* 提供)
  • 生产部署:确保最终站点根目录存在 wasm/ 目录并包含以上文件

开发与脚本

  • pnpm dev 启动示例与开发环境(默认端口 8080
  • pnpm preview 构建并预览产物
  • pnpm build 使用 Rollup 构建库输出到 dist
  • pnpm lint 代码检查
  • pnpm check:ts TypeScript 类型检查

示例页面

  • 访问 http://localhost:8080/html/single.html,拖拽或选择模型文件并选择导出格式

许可证

  • MIT