Small tool uploading assets to CDN backend (Google Cloud Storage)
Last updated 4 years ago by ivarconr .
Unlicense · Repository · Original npm · Tarball · package.json
$ cnpm install @ivarconr/cdn-uploader 
SYNC missed versions from official npm registry.


Small tool uploading assets to CDN backend (gke-storage)


You must either specify key-filename or specify credentials which is a JSON.stringify version of the JSON based keyfile containing credentials used when talking to GCE.



$ npm install cdn-uploader -g

Actual usage:

$ cdn-uploader /tmp/cdn-assets -a finnlet-server
-- Uploaded assets --

Get help:

$ cdn-uploader -h
cdn-uploader <assetsFolder> [args]

  --app-prefix, -a    Application prefix used in the CDN url          [required]
  --key-filename, -k  JSON key file used to authenticate with GCE. If not set,
                      the credentials option is used.
  --credentials, -c   Stringified version of the JSON key file used to
                      authenticate with GCE.
                      Can also be set as CDN_UPLOADER_CREDENTIALS environment
  --bucket-name, -b   Google Cloud Storage bucket to use.
                                                       [default: "fiaas-assets"]
  --project-id, -p    Google Cloud Storage projectId.     [default: "fiaas-gke"]

All options can also be set as environment variables, using the CDN_UPLOADER_ prefix. E.g.: CDN_UPLOADER_APP_PREFIX, CDN_UPLOADER_CREDENTIALS, etc.

Excluded files

All files or folder beginning with a "." is automatically excluded (e.g. .gitignore) and will not be uploaded.


You may also override other options if you like (handy for testing)

  • --key-filename - JSON key file used to authenticate with GKE. If not set FINN_CDN_UPLOADER_CREDENTIALS environment variable is used.
  • --bucket-name - GKE storage bucket to use.
  • --project-id - GKE storage projectId.

You can also use environment variables for these options, just use the prefix CDN_UPLOADER_.

Where does my files end up?

The files uploaded to GKE is made available on the public google storage hosting at:


This is again exposed by our CDN at:


Cache time?

All files uploaded to CDN is configured with Cache-Control: public, max-age=108000, meaning all your assets will be cached in 30 days.

Current Tags

  • 1.1.2                                ...           latest (4 years ago)

1 Versions

  • 1.1.2                                ...           4 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (3)
Dev Dependencies (2)
Dependents (0)

Copyright 2014 - 2017 © taobao.org |