@scripts-utils/image-converter

1.0.17 • Public • Published

🔍 Usage (scripts options)

  • --directory : PNG 이미지가 있는 디렉토리 경로 (default: './')
  • --formatFrom : 변환하려고 하는 이미지 포맷 / 미지정시 모든 [".png", ".jpg", ".jpeg", ".webp", ".avif", "gif", "bmp"] 이미지 변환
  • --formatTo : 변환하려고 하는 이미지 포맷 (default: 'webp')
  • --quality : 변환하려고 하는 이미지의 Quality (default: 90)
  • --include : 이미지 파일명에 해당 단어가 포함되는 경우에만 포맷 변환
  • --exclude : 이미지 파일명에 해당 단어가 포함되지 않는 경우에만 포맷 변환
  • --replace : 변환하려고 하는 이미지 파일 삭제 여부
  • example
    "scripts": {
      "convert-image": "image-converter --directory .next/static/media --include _webp --exclude animation --formatFrom png --formatTo webp --replace"
    },
    

🔍 process

  • argv : Node.js의 process.argv, command line arguments를 반환
  • cwd : Node.js의 process.cwd(), 현재 작업 디렉토리 경로를 반환

🔍 sharp

  • sharp : Node.js의 이미지 프로세싱 라이브러리
  • sharp 라이브러리 node 버전 제한
    "engines": {
      "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
    }
    

Package Sidebar

Install

npm i @scripts-utils/image-converter

Weekly Downloads

0

Version

1.0.17

License

MIT

Unpacked Size

5.26 kB

Total Files

3

Last publish

Collaborators

  • jakeparknpm