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

thinknode

v4.8.14

Published

A fast, flexible and all-in-one web framework for node.js.

Downloads

3,149

Readme

介绍


npm version Build Status Dependency Status

A fast, flexible and all-in-one web framework for node.js.

ThinkNode 是一款使用 ECMAScript 全新特性开发的 Node.js MVC 框架,使用 async/await 或者 Promise 解决了 Node.js 中异步嵌套的问题,并集成了项目开发中最常用的组件例如 Session、缓存、ORM等,开箱即用,让开发 Node.js 项目更加简单、高效。

特性


  1. 使用 ES6/7 全新特性来开发项目
  2. 微内核架构,合理解耦方便扩展
  3. 支持 Mysql,MongoDB,postgresSql 等多种数据库,且书写语法一致(使用thinkorm支持)
  4. Model 预加载机制,支持动态加载,动态切换数据源
  5. 开发模式下代码自动更新,无需重启 Node 服务
  6. 支持Http、WebSocket、Restful等多种访问方式
  7. 支持 File、Redis、Memcache 等多种Session及Cache
  8. 支持切面编程,支持 __before,_berore_xxx, _after_xxx 等多种魔术方法
  9. 支持 ejs 模版引擎,可以自行扩展其他解析引擎
  10. 支持国际化和多主题

async/await 示例

src/Admin/Controller/Index.js

export default class extends THINK.Controller {
    //构造方法
    init(http){
        //调用父类构造方法
        super.init(http);
        this.model = THINK.model('Home/User', {});
    }
    
    //控制器默认方法
    async indexAction () {
        let userInfo = await this.model.where({id: 1}).find();
        this.set('userInfo', userInfo);
        return this.display();
    }
}

Promise 示例

src/Admin/Controller/Index.js

export default class extends THINK.Controller {
    //构造方法
    init(http){
        //调用父类构造方法
        super.init(http);
        this.model = THINK.model('Home/User', {});
    }
    
    //控制器默认方法
    indexAction () {
        return this.model.where({id: 1}).find().then(userInfo => {
            this.set('userInfo', userInfo);
            return this.display();
        }).catch(e => {
            return this.error(e.message);
        });
    }
}

文档


https://www.gitbook.com/book/richenlin/thinknode-doc/

webstorm代码提示插件: File --> Import Settings 选择 /node_modules/thinknode/doc/webstrom_thinknode_settings.jar

快速开始


全局安装ThinkNode_kit

npm install -g thinknode_kit

创建项目

在合适的位置执行命令

thinknode new project_name

进入这个目录

cd project_name

安装依赖

npm install

启动服务

npm start

开始访问

打开浏览器,访问http://localhost:3000

贡献者


richenlin richerdlee

协议


MIT