
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
easy-sqlite3
Advanced tools
A simple tool for nodejs to use sqlite
npm i --save easy-sqlite3
const EASY_SQLITE3 = require('easy-sqlite3');
// 使用默认库表字段配置
const EASY_SQLITE3_DEMO = new EASY_SQLITE3();
// 自定义库表字段配置
const EASY_SQLITE3_DEMO = new EASY_SQLITE3({
// 数据文件存放路径,相对于运行根目录
path: 'db',
// 数据库名称
database: 'iyuxy',
// 表名称
table: 'comments',
// select字段,支持使用[]配置多个字段进行查询
key: ['pageId'],
// 表结构示例
column: {
_id: 'TEXT',
title: 'TEXT',
url: 'TEXT',
pageId: 'INTEGER',
email: 'TEXT',
nickname: 'TEXT',
comment: 'TEXT',
website: 'TEXT',
parentId: 'TEXT',
time: 'INTEGER'
}
});
// 查询关键字需要在conf中配置
EASY_SQLITE3_DEMO.selectData({pageId: 10}, (data) => {
console.log(data);
});
// 插入是字段需要与表结构名称一致
EASY_SQLITE3_DEMO.insertData({
"_id": "1015125415027768785934",
"title": "About me",
"url": "https://www.iyuxy.com/aboutme/",
"pageId": 10,
"email": "985207224@qq.com",
"nickname": "我有一万个名字",
"comment": "UI推荐好评!",
"website": "",
"parentId": "0",
"time": 1512541502780
})
updateing...
FAQs
A simple tool for nodejs to use sqlite
We found that easy-sqlite3 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.