
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
修改 think-model 作为可以独立引用后的mysql连接查询工具类,脱离thinkjs框架使用,作为处理小程序时使用。
喜欢 thinkjs 里面model的使用方式,但是又不想再写写程序的时候跑个框架,只是连接做个查询和插入,将think-model提取出来稍作修改使用。
当然,里面的代码删删减减去掉不少,也不太清楚里面的关系逻辑,简单做了个查询可以使用。
不推荐使用到生产环境。
npm install thinksql
//引入
let thinksql = require('thinksql');
//配置数据库返回实例
let model = thinksql({
database: '',
prefix: '',
encoding: 'utf8mb4',
host: '127.0.0.1',
port: '3306',
user: 'root',
password: 'root',
dateStrings: true,
logSql: true
})
//使用,使用方法与thinkjs 应该基本一致吧,没变动过什么东西
let object = await model.model('table').where({id : '1'}).find();
FAQs
修改 think-model 作为可以独立引用后的mysql连接查询工具类,脱离thinkjs框架使用,作为处理小程序时使用。
The npm package thinksql receives a total of 0 weekly downloads. As such, thinksql popularity was classified as not popular.
We found that thinksql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.