1.0.15 • Published 3 years ago

@markstien/gitbase v1.0.15

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

GitBase

基于Gitee API的键值数据库操作nodejs封装.

目录

先决条件

以下操作都基于Gitee

  1. 创建一个用于存储的仓库

  2. 设置->第三方应用->创建第三方应用

创建

权限选择如下所示

权限

  1. 完成创建后,获取Client ID 和 Client Secret

client

安装

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();

License

MIT

1.0.15

3 years ago

1.0.14

3 years ago

1.0.9

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago