@markstien/gitbase
v1.0.15
Published
基于Gitee API的键值操作封装
Downloads
5
Readme
GitBase
基于Gitee API的键值数据库操作nodejs封装.
目录
先决条件
以下操作都基于Gitee
创建一个用于存储的仓库
设置->第三方应用->创建第三方应用
权限选择如下所示
- 完成创建后,获取Client ID 和 Client Secret
安装
npm i -S @markstien/gitbase
使用
const main = async () => {
const gitBase = await GitBase({
account: "Gitee账户",
password: "Gitee密码",
clientId: "创建第三方应用获得的client id",
clientSecret: "创建第三方应用获得的client secret",
repoName: "用于存储的仓库,在第一步骤创建"
});
const addResult = await gitBase.add("GitBase");
console.log("添加结果",addResult);
const updateResult = await gitBase.update({
id: addResult,
value:"new value"
});
console.log("更新结果",updateResult);
//每一页100条记录
const listAllResult = await gitBase.listAll(1);
console.log(listAllResult)
}
main();