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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gm5/core

v2.0.4

Published

Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手

Downloads

25

Readme

  ____ _                               __ _           
 / ___(_)_   _____   _ __ ___   ___   / _(_)_   _____ 
| |  _| \ \ / / _ \ | '_ ` _ \ / _ \ | |_| \ \ / / _ \
| |_| | |\ V /  __/ | | | | | |  __/ |  _| |\ V /  __/
 \____|_| \_/ \___| |_| |_| |_|\___| |_| |_| \_/ \___|
                                                      

一个轻量级的,易学的,拓展性灵活的 nodejs MVC 框架, 5 分钟即可上手。取自"Give me five"之意, 一切就是这么简单

框架要求 nodejs 版本在 12.0 或以上, 并且只支持使用import/export

文档

文档

启用方法(步骤)

本框架和用法 都是在 Linux 或者 Mac 下面测试通过。至于使用 Windows 并坚持玩新技术的同学,我坚信他们一定有着过人的、 甚至是不可告人的兼容性 bug 处理能力,所以这部分同学麻烦在安装过程无法继续时,自行兼容一下

  1. 下载安装 Five.js 框架。
  • 为了方便下载安装及管理, 推荐使用 five-cli(这是一款专门为框架开发的脚本工具) 进行操作。

# 进入项目目录
cd /project/
# 初始化完成之后, 执行以下命令即可启动了,如果需要修改配置,可以先修改好再启动
npm create five
  1. 配置框架

建立启动文件, 如 app.js


import { createApp } from '@gm5/core'

const app = new createApp()


app.preload('./apps/') // [必须], 预加载应用目录

app.listen(3001) // 默认是3000

其他的配置和功能, 请参考 文档

  1. 启动应用。在项目根目录打开终端, 输入以下命令 npm create five, 然后根据提示操作, 即可
pm2 start app.dev.yaml
# 正式环境执行
pm2 start app.yaml
  1. 添加 nginx 配置(使用其他 web 服务,如 apache 的童鞋,请自行根据所使用的 web 服务器语法改写强烈推荐 nginx), 路径啥的自行根据自己的机器修改
upstream five_upstream {
  server 127.0.0.1:3001;
  #server 127.0.0.1:3002;
  keepalive 64;
}

server {

  listen 80;
  server_name abc.com;
  index index.html index.htm;
  root  /www/abc.com/public;

  location ~ ^/(images/|js/|css/|upload/|favicon.ico|robots.txt) {
    expires      1d;
    access_log off;
  }

  location / {
      try_files $uri
        @proxy;
  }

  location @proxy {
    proxy_set_header          X-Real-IP               $remote_addr;
    proxy_set_header          X-Forwarded-For         $proxy_add_x_forwarded_for;
    proxy_set_header          Host                    $http_host;
    proxy_set_header          X-Forwarded-Proto       $scheme;
    proxy_set_header          X-NginX-Proxy           true;
    proxy_set_header          Upgrade                 $http_upgrade;
    proxy_set_header          Connection              "upgrade";
    proxy_http_version        1.1;
    proxy_max_temp_file_size  0;
    proxy_pass                http://five_upstream;
    proxy_redirect            off;
    proxy_read_timeout        60s;
  }
}
  1. 请开始你的表演。

版权说明

本框架使用 MIT 开源协议, 一切的使用,请遵循 MIT 协议。