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

think-ts-lib

v1.0.5

Published

This is the ThinkTS core dependency.

Downloads

19

Readme

  • 💪 ORM思想用对象的方式CRUD
  • 🔥 应用级提炼封装更贴近业务场景

think-ts-lib

think-ts-libThinkTS框架 的核心依赖。之所以将核心功能拆分成单独的依赖包,是为了避免核心包版本迭代过程中影响 ThinkTS 框架层的业务逻辑。如果想使用 think-ts-lib 升级后的新功能,只需要修改 ThinkTS框架中 package.jsonthink-ts-lib 的版本,重新 install 即可。

目录结构

.
├── dist                         // 依赖目录
│   ├── config.js                // 全局配置文件
│   ├── controller.js            // 控制器
│   ├── elasticsearch.js         // ES封装
│   ├── error.js                 // 全局异常处理
│   ├── errorcode.js             // 状态码枚举
│   ├── exception.js             // 重写异常处理
│   ├── log4j.js                 // 日志输出
│   ├── index.js                 // 入口文件
│   ├── mongodb.js               // mongodb封装
│   ├── router.js                // 路由实现
│   ├── start.js                 // 初始化文件
│   ├── thinkdb.js               // mysql封装
│   ├── thinkredis.js            // redis封装
│   ├── utils.js                 // 常用工具函数
│   ├── validate.js              // 参数验证器
│   └── view.js                  // 视图处理
├── package.json                 // 配置文件
├── tsconfig.json                // TS配置文件
└── README.md                    // 项目介绍

更新

可以卸载旧版重新安装

npm uninstall think-ts-lib

npm install think-ts-lib

或者修改 package.json 里版本号安装

"think-ts-lib": "^1.2.3"

npm install

注意:例如,^1.2.3 表示安装 1.x.x 版本中最新的 1.2.x 版本,不包括 2.x.x 版本。

常用功能

  • Utils   // 常用工具函数调用,注意这是一个属性
  • Utils.createToken()   // 生成JWT TOKEN
  • Utils.validateToken()   // 验证JWT TOKEN是否正确
  • GetParams()   // 获取GET POST传参,同时可校验参数
  • ShowSuccess()   // 返回JSON格式数据
  • ApiException()   // 返回一个异常
  • Db()   // 使用MySql数据库
  • RDb()   // 使用Redis
  • EDb()   // 使用ElasticSearch
  • MDb()   // 使用MongoDB
  • M()   // 使用模型
  • Log4j()   // 使用日志处理
  • Utils.WxPay()   // 使用微信支付
  • Utils.AliPay()   // 使用支付宝支付
  • Utils.SMS()   // 使用阿里短信服务
  • Utils.OSS()   // 使用阿里对象存储

执照

ThinkTS已申请软件著作,可在中国版权保护中心中查看 CPCC.