# yuque-sync

> Sync articles and toc from Yuque

Latest version **0.2.2** (published 2019-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install yuque-sync
pnpm add yuque-sync
yarn add yuque-sync
bun add yuque-sync
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2019-10-26 |
| First published | 2019-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 37.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yudu Ban |
| Maintainers | banyudu |
| Keywords | Yuque, sync |

## Links

- npm: https://www.npmjs.com/package/yuque-sync
- Repository: https://github.com/banyudu/yuque-sync
- Homepage: https://github.com/banyudu/yuque-sync#readme
- Issues: https://github.com/banyudu/yuque-sync/issues
- npm.io page: https://npm.io/package/yuque-sync

## Dependencies (6)

- [yaml](https://npm.io/package/yaml.md) ^1.6.0
- [ts-node](https://npm.io/package/ts-node.md) ^8.3.0
- [@yuque/sdk](https://npm.io/package/@yuque/sdk.md) ^1.1.1
- [typescript](https://npm.io/package/typescript.md) ^3.5.3
- [es6-promise-pool](https://npm.io/package/es6-promise-pool.md) ^2.5.0
- [sanitize-filename](https://npm.io/package/sanitize-filename.md) ^1.6.2

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2019-10-26
- 0.2.1 — 2019-10-26
- 0.2.0 — 2019-10-26
- 0.1.4 — 2019-09-30
- 0.1.3 — 2019-09-30
- 0.1.2 — 2019-08-15
- 0.1.1 — 2019-08-15
- 0.1.0 — 2019-08-15

## README

# yuque-sync
Sync articles and toc from Yuque

## Usage

```typescript
import syncBook from 'yuque-sync'

const bookId = '<your book id or namespace>'

const outputDir = '<your target directory>'

async function foo {
    await syncBook ({
        token: process.env.YUQUE_TOKEN,
        bookId,
        dir: outputDir
    })

    // will write markdown files and sidebar.json and _sidebar(docsify) to given dir
}

```

You can provide a custom loader, to parse markdown file contents, for example replace image links.

```typescript
import syncBook from 'yuque-sync'

const bookId = '<your book id or namespace>'

const outputDir = '<your target directory>'

const myLoader = markdown => {
    // do something
    return markdown
}

async function foo {
    await syncBook ({
        token: process.env.YUQUE_TOKEN,
        bookId,
        dir: outputDir,
        loader: myLoader
    })

    // will write markdown files and sidebar.json and _sidebar(docsify) to given dir
}

```

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