# ylzcc-sdk-tools

> tools

Latest version **1.0.2** (published 2023-02-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install ylzcc-sdk-tools
pnpm add ylzcc-sdk-tools
yarn add ylzcc-sdk-tools
bun add ylzcc-sdk-tools
```

## 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.2 |
| Published | 2023-02-27 |
| First published | 2023-02-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zengyijing |
| Maintainers | zyjing |
| Keywords | github |

## Links

- npm: https://www.npmjs.com/package/ylzcc-sdk-tools
- npm.io page: https://npm.io/package/ylzcc-sdk-tools

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^1.3.3
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [typescript](https://npm.io/package/typescript.md) ^4.9.5

## Recent versions

- 1.0.2 (latest) — 2023-02-27
- 1.0.1 — 2023-02-21
- 1.0.0 — 2023-02-20

## README

# github rest api ts-node版


## 简介
此版本基于ts-node开发，集成github rest api进行封装

1.0.0版

## 支持
- 为经过身份验证的用户创建一个新的存储库
- 删除仓库
- 在存储库中创建新文件或替换现有文件
- 删除文件
- 获取存储库目录
- 获取文件内容
- 创建站点

## 示例
```javascript
import GithudRestApi from 'ylzcc-sdk-githubapi'

const config = {
  accept: '*******' 
}

const api = new GithudRestApi(config)

// 删除仓库
api.deleteARepository({
    owner: '***',
    repo: '***'
  }).then(res => {
    console.log(res);
  })

// 创建仓库
api.createARepositoryForTheAuthenticatedUser({
  name: '***'
}).then(res => {
  console.log(res);
})

// 新增/修改
api.createOrUpdateFileContents({
  owner: '***',
  repo: '***',
  path: '***',
  message: '***',
  content: '***',
  sha: '***'
}).then(res => {
  console.log(res);
})

// 获取目录
api.getRepositoryContent({
  owner: '***',
  repo: '***',
  path: '***'
}).then(res => {
  console.log(res);
})

// 删除文件
api.deleteAFile({
  owner: '***',
  repo: '***',
  path: '***',
  message: '***',
  sha: '***'
}).then(res => {
  console.log(res);
})

// 获取文件内容
api.getFileContent('***').then(res => {
  console.log(res);
})

// 创建站点
api.createAGitHubPagesSite({
  owner: '***',
  repo: '***',
  source: {
    branch: '***'
  }
}).then(res => {
    console.log(res);
})

```

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