@yhtml5/upload-images

0.6.9-beta.1 • Public • Published

yhtml5-update-images

An automated tool for compressing and optimizing JPEG or PNG images, and then upload to cdn return urls.

  1. Compress picture
  2. Upload images to cdn
  3. Return url

start

Create .config.js under the picture folder

Read the config in the root directory by default

const path = require('path')
const entry1 = path.resolve(__dirname, './images/*.{jpg,png}')

const config = {
  upload: {
    entries: [entry1],
  }
}

module.exports = config

use in the global

npm i @yhtml5/upload-images -g upload /path/to/config.js

old workflow

  • open https://tinypng.com/
  • upload images
  • download images
  • open upload images tool
  • upload images
  • copy image link

new workflow

  • npm run upload
  • return url

notice

  • 每次只上传一个文件 减轻的服务器压力

other

imagemin

/@yhtml5/upload-images/

    Package Sidebar

    Install

    npm i @yhtml5/upload-images

    Weekly Downloads

    0

    Version

    0.6.9-beta.1

    License

    MIT

    Unpacked Size

    13.2 kB

    Total Files

    10

    Last publish

    Collaborators

    • yhtml5
    • yitimo
    • hulincloud