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

threejs-guide

v1.0.0

Published

threejs

Readme

threejs-guide

typescript 高级语法

typescript 声明文件的书写

拓展 window,在window上挂载THREE。

js模块化机制

识别库的类型

库的类型不同,声明文件的写法也不同。 库的类型不同,使用方式和源码结构也不同。 反向推演,根据库地使用方式和源码结构可以知道库地类型。 根据库地类型,书写库地声明文件。

全局访问型库

不需要任何形式的import就能够在全局命名空间下访问。 案例: jQuery

模块型访问库
ES6模块

通用模块解决方案 既可以在浏览器中使用,又可以在NodeJS中使用。 案例:vue

UMD模块规范

既可以在浏览器中使用,又可以在NodeJS中使用。 根据不同的环境采取不同的引入方式 案例:moment

CommonJS模块规范,

只能在服务器环境使用,同步加载模块。 案例:express

CMD模块规范

只能在浏览器环境使用,异步加载模块。依赖就近。 案例:seal.js

AMD模块规范

只能在浏览器环境使用,异步加载模块。依赖前置。 案例:require.js

模块之间的关系是通过在模块之间建立import export联系起来的。

模块加载器的作用是在执行当前模块之前,去检查并导入当前模块的依赖项。 js模块加载器分为服务于NodeJs的CommonJS模块加载器和服务于Browser的RequireJS模块加载器。

当图像发生拉伸变形的时候,原因可能是渲染器的宽高和Canvas元素的宽高不一致。

从Threejs引擎封装WebGL的角度去学习

网格模型由一系列的几何体和材质构成 而几何体是由顶点构成

顶点信息 位置信息 颜色信息 法向量信息