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

easy-node-lang

v1.0.0

Published

A Python-syntax interpreter running on Node.js - Write Python-like code, run on Node.js

Readme

Easy-Node

一个使用 Python 语法的 Node.js 解释器。让你用 Python 的简洁语法来编写 Node.js 程序。

安装

# 从 npm 安装
npm install -g easy-node-lang

# 或从源码安装
git clone https://github.com/violettoolssite/easy-node.git
cd easy-node
npm install -g .

命令

# 运行 .ejs 文件
easy-node yourfile.ejs

# 交互模式 (REPL)
easy-node

# 安装包 (类似 pip install)
easy-node install axios
easy-node install express lodash

# 卸载包
easy-node uninstall axios

# 列出已安装的包
easy-node list

# 初始化项目
easy-node init

# 查看帮助
easy-node help

语法示例

变量

x = 5
name = "Tom"
nums = [1, 2, 3]
person = {"name": "Tom", "age": 25}

输出

print("Hello, World!")
print("x =", x)

条件判断

if x > 5:
    print("大")
elif x == 5:
    print("等于")
else:
    print("小")

循环

# for 循环
for i in range(10):
    print(i)

for item in [1, 2, 3]:
    print(item)

# while 循环
while x < 10:
    x += 1

函数

def add(a, b):
    return a + b

result = add(2, 3)
print(result)

模块导入

# 导入 Node.js 模块
import fs
import os

# 从模块导入特定函数
from fs import readFileSync, writeFileSync

# 导入自定义 .ejs 模块
import "./mymodule.ejs" as mymod
from "./utils.ejs" import helper

内置函数

  • print(*args) - 输出
  • input(prompt) - 输入
  • range(start, end, step) - 生成数字序列
  • len(obj) - 获取长度
  • str(x), int(x), float(x) - 类型转换
  • type(x) - 获取类型
  • abs(x) - 绝对值
  • min(), max() - 最小/最大值
  • sum(list) - 求和
  • sorted(list) - 排序
  • enumerate(list) - 枚举
  • zip(*lists) - 合并列表
  • map(fn, list), filter(fn, list) - 映射/过滤

示例

查看 examples/ 目录获取更多示例:

  • hello.ejs - 基础语法示例
  • file_io.ejs - 文件操作示例
  • algorithms.ejs - 基础算法示例
  • import_demo.ejs - 模块导入示例

与 Python 的区别

| 方面 | Easy-Node | Python | |------|-----------|--------| | 文件后缀 | .ejs | .py | | 运行时 | Node.js | CPython | | 可用模块 | Node.js 模块 | Python 模块 | | 包管理 | npm | pip |

License

MIT