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

node-eagle

v0.2.5

Published

基于Node的高性能MVC框架

Downloads

37

Readme

node-eagle

基于Node的高性能MVC框架

npm install node-eagle

依赖

Node8 + Koa2 + Mustache

特点

  • 高性能:不借助任何缓存,i5单核CPU可达到5400的QPS
  • route默认走controller:name+action:name,可自定义
  • 支持自动render和手动render:调用 this.render(viewName||viewPath||jsonData) 参数可选
  • 指定status后(非100),不再执行后续代码
  • controller/action/view 不区分大小写
  • 通过 this.get(key) 获取header/path/query/post参数,不区分大小写
  • 每个请求支持以下事件:onPreLoad/onPreRender/onRenderComplete,可以挂在controller跟action并列,也可以注册到context上,pre事件优先取controller,complete事件优先取context注册的事件
  • 支持页面缓存,router配置中增加代码:cache: function(ctx); 返回正整数则缓存,单位秒
  • 支持单模块视图缓存,view文件添加标签:{% view cache="60" %} 单位秒
  • 内容渲染默认采用Mustache模板引擎,可自定义渲染函数
  • 页面嵌套、引用手动实现,支持常用语法:extends/include/block,如下:

_layout.html

<body>
    {% include "./_header.html" %}
    {% block body %}
    <div>default content</div>
    {% endblock %}
    {% include "./_footer.html" %}
</body>

index.html

{% extends "../shared/_layout.html" %}
{% block body %}
<div class="body">
    {{{ content }}}
</div>
{% endblock %}

使用

1、在Node启动文件中加入以下代码:

const Koa = require("koa");
const app = new Koa();
const eagle = require("node-eagle");
const config = require("./config");

eagle(app, config);

app.listen(config.port, config.host, function(){
    console.log(`app start at ${config.host}:${config.port}`);
});

2、按照MVC规则创建站点文件,如下:

website
├ controllers
│  └ home.js
├ views
│  └ home
│     └ index.html
├ config.js
└ route.js

3、最重要的是,一定要看这个Demo: https://github.com/sqzhuyi/node-eagle-demo