open-index/open-npm huggingface dataset:
npm package: @planjs/git-utils
Description: 一个可编程和命令行的git工具集合, 基于 `nodegit` 组件包开发。
Author: yangzhoulong@icloud.com
Latest version: 0.0.5

# @planjs/git-utils
一个可编程和命令行的git工具集合, 基于 `nodegit` 组件包开发。

### 安装
```
sudo npm i -g @planjs/git-utils --unsafe-perm=true
# or
npm i -D @planjs/git-utils
```

## cli 方式调用

##### `--check=branch` 检测当前分支是否正确
```bash
gt --check=test
```
如果当前分支不是 `test` 将会报错


#### `--autoMerge=targerBranch` 切换目标分支并且合并
```bash
gt --autoMerge=develop
```
将当前分支合并到`develop`并且将本地分支切换到`develop`分支，失败条件：合并存在冲突、本地分支存在为commit内容。

#### `--check=branch --entry=/project` 指定仓库目录地址
```bash
gt --autoMerge=develop --entry=/project
```
entry参数可以指定所在仓库目录地址

## Node Api
#### 使用例子

```javascript
import GT, { openRepository } from '@quan/git-utils';
const repo = GT({ autoMerge: 'develop' })
```

###### `gitUtils(options: { check?: string, autoMerge?: string, entry?: string })`
与命令行行为一致


###### `openRepository(path?: string): Promise<Git.Repository>`
打开一个git仓库，path 参数为仓库目录路径。

###### `checkNotCommit(repo: Git.Repository): Promise<Git.Repository>`
检测本地分支是否存在为保存内容。

###### `function pull(repo: Git.Repository): Promise<Git.Repository>`
拉取远程仓库内容

###### `function switchBranch(repo: Git.Repository,name: string): Promise<Git.Repository>`
切换到对应分支

###### `mergeBranch(repo: Git.Repository,fromBranch: string): Promise<Git.Repository> `
合并对应的分支，如果发生冲突会合并失败。

###### `function push(repo: Git.Repository)`
推送到远程仓库中
npm package: @planjs/react-utils
Description: React Utils Library
Author: fupengl
Latest version: 0.0.43

# @planjs/react-utils
React Utils Library.

![NPM version](https://img.shields.io/npm/v/@planjs/react-utils.svg?style=flat)
![NPM downloads](https://img.shields.io/npm/dm/@planjs/react-utils.svg?style=flat)

## 📦 Install
npm:
```shell
npm i @planjs/react-utils --save
```
yarn
```shell
yarn add @planjs/react-utils
```

## 🔥 API
- `react hooks` collect

## 🔨 Usage

```typescript
import { useMergeState } from '@planjs/react-utils';
```

## ✅ License

[MIT](https://github.com/planjs/react-utils/blob/main/README.md)
npm package: @planjs/yuque-sdk
Description: Node SDK for yuque
Author: TZ
Latest version: 1.1.4

# ![](./logo.png)

Node SDK for [yuque](https://www.yuque.com/yuque/developer/api)

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![NPM download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/@planjs/yuque-sdk.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@planjs/yuque-sdk
[travis-image]: https://img.shields.io/travis/yuque/sdk.svg?style=flat-square
[travis-url]: https://travis-ci.org/yuque/sdk
[codecov-image]: https://codecov.io/gh/yuque/sdk/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/yuque/sdk
[david-image]: https://img.shields.io/david/yuque/sdk.svg?style=flat-square
[david-url]: https://david-dm.org/yuque/sdk
[snyk-image]: https://snyk.io/test/npm/@planjs/yuque-sdk/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/@planjs/yuque-sdk
[download-image]: https://img.shields.io/npm/dm/@planjs/yuque-sdk.svg?style=flat-square
[download-url]: https://npmjs.org/package/@planjs/yuque-sdk

## Install

```bash
npm i @planjs/yuque-sdk --save
```

## Usage

```js
const SDK = require('@planjs/yuque-sdk');
const client = new SDK({
  token: '<YOUR TOKEN>',
  // other options
});

const result = await client.users.get();
console.log(result);

// apis
const { users, groups, repos, docs } = client;
```

## Options

```js
/**
 * @param {Object} options - opts
 * @param {String} options.token - yuque token, https://www.yuque.com/settings/tokens
 * @param {String} [options.endpoint] - yuque endpoint
 * @param {String} [options.userAgent] - request user-agent
 * @param {Object} [options.requestOpts] - default request options of [urllib](https://www.npmjs.com/package/urllib)
 * @param {Function} [options.handler] - special how to handler response
 */
```

by default, will return `response.data.data`, you can custom it by `handler`:

```js
new SDK({
  handler(res) {
    // should handler error yourself
    if (res.status !== 200) {
      const err = new Error(res.data.message);
      /* istanbul ignore next */
      err.status = res.data.status || res.status;
      err.code = res.data.code;
      err.data = res;
      throw err;
    }
    // return whatever you want
    const { data, abilities } = res.data;
    return data;
  },
});
```

## Debug

```js
$ http_proxy=http://127.0.0.1:8888 TOKEN=<YOUR_TOKEN> npm test
```

## API

see [Yuque API Docs](https://www.yuque.com/yuque/developer/api) for more details.

### users

see the source.

### groups

see the source.

### repos

see the source.

### docs

see the source.

## TODO

- [ ] API docs
- [ ] JSDocs definition for result info
- [ ] add `d.ts` or refactor to TypeScript