# grunt-dj-oss-up

> A grunt tool for uploading static file to aliyun oss.

Latest version **0.2.0** (published 2016-11-18) · 0 weekly downloads

## Install

```sh
npm install grunt-dj-oss-up
pnpm add grunt-dj-oss-up
yarn add grunt-dj-oss-up
bun add grunt-dj-oss-up
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2016-11-18 |
| First published | 2016-11-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zbao |
| Maintainers | zbao |
| Keywords | gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-dj-oss-up
- Repository: https://github.com/z719725611/grunt-dj-oss-up
- Issues: https://github.com/z719725611/grunt-dj-oss-up/issues
- npm.io page: https://npm.io/package/grunt-dj-oss-up

## Dependencies (4)

- [co](https://npm.io/package/co.md) ~4.6.0
- [async](https://npm.io/package/async.md) ^0.9.0
- [chalk](https://npm.io/package/chalk.md) ^0.5.1
- [ali-oss](https://npm.io/package/ali-oss.md) ~4.6.2

## Recent versions

- 0.2.0 (latest) — 2016-11-18
- 0.1.0 — 2016-11-16

## README

# grunt-ali-oss-upload

> A grunt tool for uploading static file to aliyun oss.

## Getting Started

```shell
npm install grunt-dj-oss-up --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-dj-oss-up');
```

## The "oss" task


### Options


#### options.accessKeyId
Type: `String`

A string value that is your aliyun oss accessKeyId.

#### options.accessKeySecret
Type: `String`

A string value that is your aliyun oss accessKeySecret.

#### options.bucket
Type: `String`

A string value that is your aliyun oss bucket.

#### options.region
Type: `String`

A string value that is your aliyun oss region.

#### options.objectGen
Type: `Function`

Default: 
```js
function(dest, src){
	return [dest, path.basename(src)].join('\/');
}
```

### Example
```js
grunt.initConfig({
   oss: {
              upload:{
                  options: {
                      accessKeyId:'<%= cdn["js.ak"] %>',
                      accessKeySecret: '<%= cdn["js.sk"] %>',
                      bucket:'<%= cdn["js.bucket"] %>',
                      region:'<%= cdn["js.region"] %>'
                  },
                  files: [
                      {
                          cwd: '<%= config.view_dest %>',
                          src: ['build/*.js']
                      }
                  ]
              }
          },
});
```

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