1.0.17 โข Published 10 months ago
@scripts-utils/image-converter v1.0.17
@scripts-utils/image-converter
๐ 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" }