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

x-live2d

v1.0.5

Published

基于Cubism4封装的live2组件

Readme

使用 https://www.live2d.com/download/cubism-sdk/#sdk3

使用许可协议及SDK下载 https://www.live2d.com/zh-CHS/download/cubism-sdk/download-web/

live2dcubismcore.min.js文件需要自己从官网下载,官方不允许分发

使用前注意

  • 基于CubismSdkForWeb-4 版本进行的封装,需要moc3模型(包含的材质文件是Haru.2048(模型名.图片尺寸),而非textures的文件夹,motions下文件按数字递增)
  • public/live2d/core/live2dcubismcore.min.js 根目录下需要存在该文件
  • live2d/resources 下存在模型文件(moc3格式) 可导入官方SDK目录下Resources文件 或 下方地址
  • CubismSdkForWeb修改后源码下载 https://gitee.com/xyzgy/cubism-sdk-for-web

安装

npm i x-live2d

使用

import live2d from "x-live2d/live2d.vue";
components: { live2d }

<live2d :show="true" >
//对话框,工具条使用slot允许自定义
<template v-slot:info></template>
<template v-slot:tool></template>
</live2d>

注意

  • ~在app.vue文件中使用,暂时未解决单页面使用,切换页面之后全局变量Live2DCubismCore带来的各种问题~
  • 1.0.3 版本解决上述问题

模型文件说明

  • 模型数据(moc3)
  • 动态数据(motion3.json)
  • 模型设定文件(model3.json)
  • 物理模拟设定文件(physics3.json)
  • 表情数据(exp3.json)
  • 姿势设定文件(pose3.json)
  • 显示辅助文件(cdi3.json)
  • 声音文件(wav)

模型地址 (不适用CubismSdkForWeb4版本)

  • 需要moc3模型(包含的材质文件是Haru.2048(模型名.图片尺寸),而非textures的文件夹),motions下文件按数字递增
  • https://gitee.com/xyzgy/live2d-model
  • https://gitee.com/xyzgy/live2d-model-2

参考文档

  • https://blog.csdn.net/weixin_44128558/article/details/104792345
  • https://blog.csdn.net/hb_zhouyj/article/details/108625888
  • https://github.com/chendishen/react-live2d

x-live2d使用说明

  • 基于vue3开发,可根据需要配合bundle.js进行二次封装

参数

| 字段 | 说明 | 类型 | 默认值 | 备注 | | ---- | ---- | ---- | ---- |---- | | position | live2d位置 | String | "bottom: 10px;right: 10px;" | | show | live2d显示与隐藏 | Boolean | true| 全局一次性引入,通过改变该字段值控制在页面的显示与隐藏 | live2dcubismcore | live2dcubismcore 路径 | String | "live2d/core/live2dcubismcore.min.js" | public目录下 | resourcesPath | 模型根路径 | String | "live2d/resources/" | public目录下 | modelDir | 模型目录名| Array | ["Haru", "Hiyori"]| | backImageName| 背景图片 | String| '' | | gearImageName | 右上角齿轮 | String | null | debugLogEnable| 是否调试模式 | Boolean | false | headMessage | 点击头部显示文案 | Array | [ "讨厌~不要掐人家的脸嘛~"] | bodyMessage | 点击身体 | Array |["哼,坏人"] | defaultMessage | 未监听指定区域时显示文案 | Array |["我是谁"] | isGlobal | 模型是否跟随全局鼠标移动 | Boolean | true | isAuto | 是否自动显示预设文案 | Boolean | true | autoSpeakTime | 文案自动切换间隔 | Number | 5000

方法

| 字段 | 说明 | 备注 | ---- | ---- | ---- | | initLive2d | 初始化模型 | nextScene | 切换下一个模型 | changeScene(index) | 切换指定模型 | | addEventListener |全局监听 | mousedown | 点击模型

bundle.js 导出变量

  • LAppDefine 初始化对应变量
  • LAppDelegate 模型的初始化及销毁等
  • LAppLive2DManager 模型的信息及相关交互