Code Monkey home page Code Monkey logo

cdn's Introduction

cdn Uploader

Installing

Global

Yarn yarn global add ty-cdn

Npm npm install -g ty-cdn

Library

Yarn npm install ty-cdn

Npm yarn add ty-cdn

Global Usage

Usage: cdn -t [str] -e [str] -f [str[]] -u [str]
-p [pwd]

Options:
  --help     Show help                       [boolean]
  --version  Show version number             [boolean]
  -t         team directory                 [required]
  -e         environment directory          [required]
  -b         build version
  -d         Absolute directory
  -f         list of files          [array] [required]
  -u         sftp username                  [required]
  -p         sftp password                  [required]
  -h         sftp host
  -w         sftp port

Uploading files

Basic Usage

cdn -u username -p password -t mobileweb -e develop -f library.js

Uploads library js to cdn with with /username/mobileweb/develop/library.js

With Build Number

cdn -u username -p password -t mobileweb -e develop -b 123 -f library.js

Uploads library js to cdn with with /username/mobileweb/develop/123/library.js

Absolute Directory

cdn -u username -p password -t mobileweb -e develop -d /absolute -f library.js

Uploads library js to cdn with with /username/absolute/library.js

Multiple Files

cdn -u username -p password -t mobileweb -e develop -f library.js anotherlibrary.js

Uploads library js to cdn with with /username/mobileweb/develop/library.js Uploads library js to cdn with with /username/mobileweb/develop/anotherlibrary.js

Library Usage

Options

const cdn = require('cdn');
const options = {
  team: 'mobileweb',
  environment: 'dev,
  buildVersion: '123', //optional
  user: 'username',
  password: 'password',
}

Single file

cdn.upload('~/acg/desktop/index.js', options);

Array of files

cdn.upload(['~/acg/desktop/index.js', '~/acg/desktop/library.json'], options);

Object for custom configuration

cdn.upload({
    source: '~/acg/desktop/index.js',
    remote: 'index.min.js'
}, options);
//File will be available with url: `/username/mobileweb/dev/index.min.js`

Multiple objects for custom configuration

cdn.upload([
  {
    source: '~/acg/desktop/index.js',
    remote: 'index.min.js'
  },
  {
    source: '~/acg/desktop/library.json',
    remote: 'library.min.json'
  }
], options);
//File will be available with url: `/username/mobileweb/dev/index.min.js`
//File will be available with url: `/username/mobileweb/dev/library.min.json

cdn's People

Contributors

acanguven avatar

Watchers

James Cloos 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.