cdn-upload
``` $ npm install -g cdn-upload ```
Last updated 2 years ago by gaogao1030 .
ISC · Original npm · Tarball · package.json
$ cnpm install cdn-upload -g
SYNC missed versions from official npm registry.

cdn-upload

Synchronize all files in your specified local directory to the CDN (currently only supports qiniu)

Installation

  $ npm install -g cdn-upload

Usage

  Usage: cdn-upload <config path> [env]

  Upload file to cdn. the default configuration path for the configuration file is config/cdn_upload.json


  Options:

    -V, --version  output the version number
    -h, --help     output usage information

  Examples:

    $ cdn-upload config/cdn_upload.json beta
    

Test

  npm run test // run this command before ensure .env was configured and available

Configuration

config/upload_assets.json:

{
  "default": {
    "cachedFile": "../build/assets_cache.json",
    "localDirectory": "../public",
    "remoteDirectory": "test/public",
    "bucket": "your cdn bucket",
    "cdn": "qiniu",
    "envFile": ".env",
    "ignore": ['a.html', 'b/**/**'], // glob ignore sytax that a.html is localdirectory/a.html and b/**/** will localdirectory/b/**/**
    "concurrency": 8 // Number of concurrent processes (default: cpu count)
    "cleanPrevCdnFiles": true // Remove previous cdn files after uploaded (Recommended Use this feature. default: true)
  },
  "beta": {
    "remoteDirectory": "test/beta/public",
    "concurrency": 4
    "cleanPrevCdnFiles": false
  },
  "release": {
    "remoteDirectory": "test/release/public",
    "concurrency": 8
  },
  "production": {
    "remoteDirectory": "test/production/public",
    "concurrency": 16
  }
}

.env:

QINIU_ACCESS_KEY="qiniu access key"
QINIU_SECRET_KEY="qiniu secret key"

You should add .env and assets_cache.json files in .gitignore.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gaogao1030/cdn-upload.

Current Tags

  • 1.5.1                                ...           latest (a month ago)

21 Versions

  • 1.5.1                                ...           a month ago
  • 1.5.0                                ...           2 months ago
  • 1.3.0                                ...           4 months ago
  • 1.2.3                                ...           7 months ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.9                                ...           a year ago
  • 1.1.8                                ...           a year ago
  • 1.1.7                                ...           2 years ago
  • 1.1.6                                ...           2 years ago
  • 1.1.5                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 43
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |