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

@li880103/core

v1.0.0

Published

Node-PHP 核心服务器 — HTTP + 静态文件 + 动态加载已安装的 @li880103/php-* 版本包

Downloads

98

Readme

@li880103/core

可选服务器层:一个纯 Node.js 的 HTTP 服务器,负责静态文件服务和 .php 请求处理,并动态加载已安装的 @li880103/php-* 版本包。配合 @li880103/php-* 使用,无需系统 PHP。

安装

# 全局安装(含一个 PHP 版本包)
npm install -g @li880103/core @li880103/php-8.1

要求 Node.js >= 20.10。

命令行用法

node-php                                # 默认端口 3000,根目录为当前目录,自动选最新已安装版本
node-php --port=8080 --php-version=8.1  # 指定端口与 PHP 版本
node-php --root=/var/www/html           # 指定网站根目录
node-php --help                         # 显示帮助

作为库使用

const { startServer } = require('@li880103/core');

const server = startServer({
  port: 8080,        // 监听端口
  version: '8.1',    // PHP 版本(不传则自动选已安装的最新版)
  rootDir: './public', // 网站根目录
});

可用版本包

| 版本包 | 说明 | | --- | --- | | @li880103/php-7.4 | PHP 7.4 WASM 引擎,npm install 后直接使用,详见同目录 README | | @li880103/php-8.0 | PHP 8.0 WASM 引擎,npm install 后直接使用,详见同目录 README | | @li880103/php-8.1 | PHP 8.1 WASM 引擎,npm install 后直接使用,详见同目录 README | | @li880103/php-8.2 | PHP 8.2 WASM 引擎,npm install 后直接使用,详见同目录 README | | @li880103/php-8.3 | PHP 8.3 WASM 引擎,npm install 后直接使用,详见同目录 README | | @li880103/php-8.4 | PHP 8.4 WASM 引擎,npm install 后直接使用,详见同目录 README |

各版本包作为本包的 optional peerDependencies,按需安装,缺哪个版本装哪个即可(npm install @li880103/php-8.1)。

说明

  • 静态文件自动识别 MIME(基于 mime-types);目录请求自动查找 index.html / index.htm
  • .php 请求走 WASM 引擎执行(自动把文件所在目录挂载进 WASM),返回渲染后的 HTML
  • 未指定版本时自动选择已安装的最新 PHP 版本,也可用 --php-versionversion 显式指定
  • 首次执行需编译 20MB+ WASM,耗时数秒,之后实例复用

许可

本包装配代码为 MIT;PHP 引擎本体来自 GPL-2.0-or-later 的 php-wasm(WordPress Playground)。