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

one-yeheng

v1.0.3

Published

A simple Tetris game

Downloads

16

Readme

one-yeheng

一个简单的俄罗斯方块游戏

安装

你可以通过 npm 安装这个包:

npm install one-yeheng

使用方法

const { startGame } = require('one-yeheng');
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>俄罗斯方块 - one-yeheng</title>
  <link rel="stylesheet" href="./node_modules/one-yeheng/style.css">
</head>
<body>
  <h1>俄罗斯方块</h1>
  <div id="game-board">
    <div id="score">得分: 0</div>
    <canvas id="tetris" width="300" height="600"></canvas>
    <button id="start-button">开始游戏</button>
  </div>
  <script src="./node_modules/one-yeheng/index.js"></script>
</body>
</html>

## 介绍

游戏控制
← 左箭头:向左移动方块。

→ 右箭头:向右移动方块。

↓ 下箭头:加速方块下落。

↑ 上箭头:旋转方块。

游戏界面
游戏区域:一个 10x20 的网格,方块会从顶部下落。

得分:显示在游戏区域上方。

游戏规则
方块会从顶部随机生成并下落。

使用键盘控制方块的移动和旋转。

当一行被填满时,该行会消失,并增加得分。

当方块堆叠到顶部时,游戏结束。

## 技术细节
技术栈
HTML:用于构建游戏界面。

CSS:用于美化游戏界面。

JavaScript:用于实现游戏逻辑。

Node.js:用于运行本地服务器。

## 主要功能
方块生成:随机生成 7 种不同形状的方块。

碰撞检测:检测方块是否触底或与其他方块碰撞。

消除行:当一行被填满时,消除该行并更新得分。

游戏结束:当方块堆叠到顶部时,游戏结束。

许可证
本项目基于 MIT 许可证 开源。详情请参阅 LICENSE 文件。