# @markstien/gitbase

> 基于Gitee API的键值操作封装

Latest version **1.0.15** (published 2021-02-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install @markstien/gitbase
pnpm add @markstien/gitbase
yarn add @markstien/gitbase
bun add @markstien/gitbase
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.15 |
| Published | 2021-02-26 |
| First published | 2021-02-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 27.7 KB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| Author | markstien |
| Maintainers | markstien |
| Keywords | key, value, Gitee, Api |

## Links

- npm: https://www.npmjs.com/package/@markstien/gitbase
- Repository: https://gitee.com/markstien/gitee-database
- Homepage: https://gitee.com/markstien/gitee-database.git
- npm.io page: https://npm.io/package/@markstien/gitbase

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [axios](https://npm.io/package/axios.md) ^0.21.1

## Recent versions

- 1.0.15 (latest) — 2021-02-26
- 1.0.14 — 2021-02-25

## README

# GitBase

基于Gitee API的键值<del>数据库</del>操作nodejs封装.

# 目录


* [先决条件](#先决条件)

* [安装](#安装)

* [使用](#使用)

* [License](#License)


## 先决条件

以下操作都基于[Gitee](https://gitee.com)

1. 创建一个用于存储的仓库

2. 设置->第三方应用->创建第三方应用

![创建](./docs/images/app.png)

权限选择如下所示

![权限](./docs/images/img.png)

3. 完成创建后，获取Client ID 和 Client Secret

![client](./docs/images/img_1.png)

## 安装
```shell
npm i -S @markstien/gitbase
```


## 使用

```ts
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](./LICENSE)

---
_Source: https://npm.io/package/@markstien/gitbase · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
