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

eaglet

v1.0.0

Published

最简单直接的 Koa2 的脚手架 - **eaglet**

Downloads

4

Readme

最简单直接的 Koa2 的脚手架 - eaglet

哲学

我不想知道你的哲学,但我想立即开始并完成工作

  • 迅速开发 - 自动热重启服务 + 测试驱动开发模式 + 重置数据库(by cli)
  • 生产就绪 - 有 node 和 npm 马上可以部署,不用安装任何东西
  • 从众 - 80%人会做的设计决定(design decision)和 80%人会使用的库(library)
  • 结构简单 -  routes + MVC + 中间件(Middleware)
  • 没有魔法 - 可由 app.js 开始 , 25 分钟读懂的代码(易用,易写,易看,易学的车子结构应用和实践,用了对 node js 和 koa2 必有更多的理解)

特别之处

  1. 没有 babel 配置(Node 9)
  2. Nodemon 自动热重启服务
  3. 自带会员系统 (可选)(Passport js)
  4. 邮件服务 (Sparkpost)
  5. 对象关系映射(ORM) (Sequelize)
  6. 多个配置(/.env production.json,test.json,development.json)
  7. koa-router

定位

  • koa 2 入门至中级䦕发者
  • 1-5 小团队快速开发
  • 小微 IT 企业

P.S 如果你的开发团队人数大于 10 人且人人都是 koa 大神,eggjs 会是更适合你

技术堆栈

  1. Node js
  2. koa2
  3. Sequelize
  4. Mysql/SQlite

安装并运行

1. git clone [email protected]:chungchi300/eaglet.git
//更改 database
2. src/config/default.js  (default sqlite but suggest mysql in production)
3. npm i && npm run reset && npm start

访问

  • http://localhost:3000
  • http://localhost:3000/feedback

测试服务器

  • http://45.76.76.16:3000/
  • http://45.76.76.16:3000/feedback

开发模式

文件修改后 nodemon立即自动重启 Node.js 服务

npm run start

在优酷上观看

测试驱动开发模式

文件修改后 Jest立即自动重新运行所有测试

npm run test

在优酷上观看

线上模式

使用 pm2 是 node 进程管理器,如果 node 进程崩溃立即自动重启进程

npm run production

在优酷上观看

配置&&部署线上

默认配置文件位于 src/config/default.js.

.env 配置会覆盖(override) 默认配置.

e.g

.env/production.json 覆盖 src/config/default.js 配置

线上 3000 port 转 80

https://stackoverflow.com/questions/16573668/best-practices-when-running-node-js-with-port-80-ubuntu-linode

谢谢

使用部分代码和概念于

17koa2

koa2-server