New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

think_model

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

think_model

Model Middleware for ThinkKoa, use ThinkORM.

latest
npmnpm
Version
2.2.2
Version published
Maintainers
1
Created
Source

介绍

npm version Dependency Status

Model for ThinkKoa, used ThinkORM

注意

仅适用于ThinkORM 3.x版本。预加载项目模型类,并创建连接池。

安装

npm i think_model --save

使用

1、项目中增加中间件 middleware/model.js

module.exports = require('think_model');

2、项目中间件配置 config/middleware.js:

list: [...,'model'], //加载的中间件列表
config: { //中间件配置
    ...,
    model: {
        db_type: 'mysql', //support  postgresql,mysql...
        db_host: '127.0.0.1',
        db_port: 3306,
        db_name: '',
        db_user: '',
        db_pwd: '',
        db_prefix: 'think_',
        db_charset: 'utf8'
    }
}

FAQs

Package last updated on 23 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts