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

uunode

v1.0.8

Published

<del>一款老少咸宜的游戏🎮</del>

Readme

uunode

一款老少咸宜的游戏🎮

一个将 js 转化为 mjs,从而方便调试的小工具。

一、概述

Node verison 13.2.0 起开始正式支持 ES Modules 特性,有两种方法可以应用:

  1. package.json 中设置 "type": "module"
  2. 将文件后缀改变为 mjs

根据第二个方法,为了便利化调试,我开发了一个命令行工具—— uunode,它会将 js文件自动转化自动转化为 mjs, 并执行相应的返回结果。

注意:

  1. 若不添加上述两项中任一项,直接在 Node 中使用 ES Modules,则会抛出警告:

Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

  1. 根据 ESM 规范,使用import 关键字并不会像 CommonJS 模块那样,在默认情况下以文件扩展名填充文件路径。因此,ES Modules 必须明确文件扩展名

二、安装

npm 使用:

npm install uunode -g

yarn 使用:

yarn add uunode -g

(linux 显示没有权限的话请在前面加上 sudo, 即 sudo npm install uunode -g 或者 sudo yarn add uunode -g)

三、使用示例

uunode [example.js]

2021-06-24_2281841392291411363 33 52

如示例所示,当我们运行 uunode [example.js] 时,它会产生一个 .uunode 的文件夹,里面储存着将 mjs 文件(默认不保留文件,你可以加 -k 参数保留文件)。并执行 node .uunode/example.js 返回相应的结果。

你还可以使用 uunode [example.js] -s 去掉 console

参数支持项:

| 参数值 | 含义 | | ------ | ---------------- | | -s | 去除 console | | -k | 保留生产后的菜单 |

四、更多

  1. 手把手教你写Node.js命令行程序

  2. 如何从零开始开发一个 node.js 命令行(cli)工具

  3. 什么是amd、commonjs、umd、esm?

  4. 2020年我们可以在Node中使用ES Modules了吗