Giter VIP home page Giter VIP logo

nodejs-alioss's Introduction

alioss

阿里云 OSS 命令行。

install

npm install -g alioss

api

  • alioss upload \[dir] 上传指定目录到阿里云 OSS
  • alioss version 输出版本信息
  • alioss json \[dir] 在指定目录生成 alioss.json 模板文件
  • alioss help 输出帮助信息

alioss.json

{
    "accessKeyId": "your_accessKeyId",
    "accessKeySecret": "your_accessKeySecret",

    // 仓库
    "bucket": "your_bucket",

    // OSS 所在的域
    "host": "oss-cn-hangzhou.aliyuncs.com",

    // 缓存时间,默认 1 年
    "cacheControl": "max-age=315360000",

    // 待上传资源的源目录,相当于`alioss.json`所在的目录
    "src": "./",

    // 上传的文件列表,支持通配符,相对于 src
    "upload": [
        "./**/*"
    ],

    // 上传的 CDN 目录
    "dest": "/test/",

    // 并行上传数量,默认10
    "parallel": 10
}

example

假设当前的资源目录是这样的:

- static
|-- js
|   `-- app
|       |-- abc.js
|       `-- def.js
|-- css
`-- alioss.json

要上传的资源为./static/js/app/*,线上的 CDN URL 为/example.com/abc.js

{
    ...
    upload: [
        './**/*'
    ],
    src: './static/js/app/',
    dest: '/example.com/'
}

nodejs-alioss's People

Contributors

cloudcome avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.