# bos-upload-dir

> A uploader is use for upload directory to bos.

Latest version **1.0.1** (published 2018-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install bos-upload-dir
pnpm add bos-upload-dir
yarn add bos-upload-dir
bun add bos-upload-dir
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-05-18 |
| First published | 2018-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.0.0 |
| Dependencies | 3 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zhanfang |
| Maintainers | zhanfang |
| Keywords | bos, directory |

## Links

- npm: https://www.npmjs.com/package/bos-upload-dir
- Repository: https://github.com/zhanfang/bos-upload-dir
- Homepage: https://github.com/zhanfang/bos-upload-dir#readme
- Issues: https://github.com/zhanfang/bos-upload-dir/issues
- npm.io page: https://npm.io/package/bos-upload-dir

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [bce-sdk-js](https://npm.io/package/bce-sdk-js.md) ^0.2.9

## Recent versions

- 1.0.1 (latest) — 2018-05-18
- 1.0.0 — 2018-05-18

## README

# bos-upload-dir
上传文件夹至bos。

## 使用
### 安装
```bash
npm install bos-upload-dir
```

### 配置

```js
const path = require('path');
const Uploader = require('bos-upload-dir');


const uploader = new Uploader({
    bos: {
        credentials: {
            ak: 'xxxxxxxx',
            sk: 'xxxxxxxx'
        },
        endpoint: 'http://xx.xxx.com',
        bucketName: 'xxx',
        urlPrefix: '//xxx.bdstatic.com/'
    },
    prefix: 'test'
});
// 上传 lib 文件夹下的文件至 bos
uploader.uploadDir(path.resolve(__dirname, 'lib')).then(() => console.log('done'));

```

## Options
name    | type     | default | required | Description
----    | ---      | ----    |    ---   |     ---
bos     | {Object} |         |    true  | bos相关配置，具体可参考百度云文档
prefix  | {String} | ''      |    false | 上传至 bos bucket 下的前缀路径

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