项目作者: rphillips-nz

项目描述 :
:bird: The uncomplicated image resizing pipeline.
高级语言: JavaScript
项目地址: git://github.com/rphillips-nz/pyper.git
创建时间: 2021-05-22T11:06:14Z
项目社区:https://github.com/rphillips-nz/pyper

开源协议:MIT License

下载


Unrelated image of a sandpiper


Pyper


The uncomplicated image resizing pipeline.

Features

Usage

Development

License


Features

  • 📄 Supports any image type supported by sharp/libvips
  • 📏 Multiple input rules each with multiple outputs
  • ✳️ Glob input file selection
  • 🚀 Fast resizing with sharp/libvips
  • 👀 Skips already-resized images with a cache for fast subsequent runs

Usage

  1. Usage: pyper [options]
  2. Options:
  3. -v, --version output the current version
  4. --verbose output debugging
  5. -h, --help display help for command

Create a .pyper.json file in the folder you want to run pyper from.
Here’s one that creates three different versions of each of the images in the images folder.

  1. [
  2. {
  3. "input": "images/*",
  4. "outputs": [
  5. {
  6. "path": "output/{basepath}/{filename}-35{extension}",
  7. "width": 35,
  8. "height": 35
  9. },
  10. {
  11. "path": "output/{basepath}/{filename}-100.webp",
  12. "format": "webp",
  13. "width": 100,
  14. "height": 100
  15. },
  16. {
  17. "path": "output/{basepath}/{filename}-100{extension}",
  18. "width": 100,
  19. "height": 100,
  20. "options": {
  21. "quality": 10
  22. }
  23. }
  24. ]
  25. }
  26. ]

Development

Pyper is run as the CLI command pyper.

  1. npm install
  2. npm link

You should then be able to run this in another folder:

  1. pyper

License

MIT