clone-kit

1.3.0 • Public • Published

Clone kit

Clone assets from server

Use case

  • Clone assets before running a project in development mode
  • Clone assets in build directory before deployment

Usage

Add clone kit configuration with name clone-kit.json at root of the project.

{
  // Custom http headers to clone the assets
  "headers": Object,

  // Clone assets only if not present (Default: false)
  "once": Boolean,

  // Required
  // List of files to be cloned
  "files": [
    {
      // Name of the asset
      "name": String,

      // Required
      // Url of the asset
      "src": Url,

      // Required
      // File path where asset need to be cloned
      "dst": String,

      // Custom http headers to clone this asset
      // Overrides "headers" declared above
      "headers": Object,

      // Clone this asset only if not present (Default: false)
      // Overrides "once" declared above
      "once": Boolean
    }
  ]
}

Example

clone-kit.json

{
  "files": [
    {
      "name": "jQuery",
      "src": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js",
      "dst": "example/folder1/jquery.js",
      "once": true
    },
    {
      "name": "Axios",
      "src": "https://cdnjs.cloudflare.com/ajax/libs/axios/0.27.2/axios.min.js",
      "dst": "example/folder2/axios.js"
    }
  ]
}
npx clone-kit

# or

npx clone-kit ./clone-kit-config-file.json

Logs

Symbol Meaning
Assets cloned/copied
~ Assets reused
X Error

Readme

Keywords

none

Package Sidebar

Install

npm i clone-kit

Weekly Downloads

0

Version

1.3.0

License

MIT

Unpacked Size

4.35 kB

Total Files

3

Last publish

Collaborators

  • neilveil