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

iijs

v4.4.4

Published

A simple and lightweight MVC framework built on nodejs+koa2

Downloads

66

Readme

项目更名为jj.js,并更换仓库地址:

Github:https://github.com/yafoo/jj.js

Gitee:https://gitee.com/yafu/jj.js

官网:https://me.i-i.me/jjjs/

iijs

iijs

A simple and lightweight MVC framework built on nodejs+koa2

项目介绍

一个基于nodejs+koa2构建的简单轻量级MVC框架,最低依赖仅仅koa和koa-router。

项目地址:https://github.com/yafoo/iijs

开发手册:https://me.i-i.me/iijs/

安装

npm i iijs

基本使用

const {app, Controller, Model, Db, Pagination, View, Ctx, Context, Logger} = require('iijs');

应用结构

├── app             //应用目录 (非必需,可更改)
│  ├── controller   //控制器目录 (非必需,可更改)
│  │  └── index.js  //控制器
│  ├── view         //模板目录 (非必需,可更改)
│  │  └── index     //index控制器模板目录 (非必需,可更改)
│  │     └── index.htm //模板
│  ├── model        //模型目录 (非必需,可更改)
│  ├── logic        //逻辑目录 (非必需,可更改)
│  ├── pagination   //分页目录 (非必需,可更改)
│  └── ****         //其他目录 (非必需,可更改)
├── app2            //应用2目录 (非必需,可更改)
├── common          //公共应用目录 (非必需,可更改)
├── config          //配置目录 (非必需,不可更改)
│  ├── app.js       //APP配置 (非必需,不可更改)
│  ├── db.js        //数据库配置 (非必需,不可更改)
│  ├── routes.js     //路由配置 (非必需,不可更改)
│  └── ****         //其他配置 (非必需,可更改)
├── public          //静态访问目录 (非必需,可更改)
│  └── static       //css image文件目录 (非必需,可更改)
├── node_modules    //nodejs模块目录
├── server.js       //应用入口文件 (必需,可更改)
└── package.json    //npm package.json

应用入口

// server.js
const {app} = require('iijs');

app.run(3000, '127.0.0.1', function(err){
    if(!err) console.log('http server is ready on 3000');
});

Hello world !

// app/controller/index.js
const {Controller} = require('iijs');

class Index extends Controller {
    async index() {
        await this.display('Hello iijs, hello world !');
    }
}

module.exports = Index;

浏览器访问地址:http://127.0.0.1:3000,页面输出:Hello iijs, hello world !

使用手册

开发手册:https://me.i-i.me/iijs/

应用案例

Nginx代理

location / {
    proxy_pass       http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

License

MIT