Socket
Book a DemoInstallSign in
Socket

@pzj01/picpress

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pzj01/picpress

A image format conversion and compression tool

latest
Source
npmnpm
Version
0.3.6
Version published
Maintainers
1
Created
Source

Introduction

Image compression and format conversion tools

Install

pnpm add @pzj01/picpress

Usage

Config

use picpress.config.js or picpress.config.ts

import { defineConfig } from '@pzj01/picpress'

export default defineConfig({
  entry: '.image', // entry file or folder path
  output: './.picpress', // output directory
  minFileSize: 0, // handle images larger than or equal to this value
  recursive: true, // whether to recursively find images in subfolders
  overwrite: true // whether to overwrite existing files
})

Compress

compress images.

import { PicPress } from '@pzj01/picpress'

const pic = new PicPress({
  entry: '.image',
  output: './.picpress',
  minFileSize: 0,
  recursive: true,
  overwrite: true
})

await pic.compress() // use default config
await pic.compress({
  quality: 60
}) // compress all images with quality 60
await pic.compress('./image', {
  quality: 60
}) // compress ./image with quality 60

Transform

transform images format.

import { PicPress } from '@pzj01/picpress'

const pic = new PicPress({
  entry: '.image',
  output: './.picpress',
  minFileSize: 0,
  recursive: true,
})

await pic.transform() // use default config
await pic.transform({
  targetFormat: 'webp'
}) // transform all images to webp
await pic.transform('./image', {
  targetFormat: 'webp'
}) // transform ./image to webp

CLI

use @pzj01/picpress in command line

pnpm dlx @pzj01/picpress compress

or install afterward use

pnpm @pzj01/picpress compress

Commands

  • picpress compress: compress images
pnpm @pzj01/picpress compress --entry .image --quality 60 --overwrite
  • picpress transform: transform images format
pnpm @pzj01/picpress transform --entry .image --target-format webp

Global Options

  • --entry [...paths]: entry file or folder path, support single path or path array
  • --output <output>: output directory
  • --minFileSize <size>: handle images larger than or equal to this value
  • --source-formats [...formats]: source image formats filter
  • --recursive: whether to recursively find images in subfolders
  • --delete-original: whether to delete the original file

Compress Options

  • --quality <quality>: image quality
  • --preserve-metadata: whether to keep the original image metadata
  • --overwrite: whether to overwrite the original file

Transform Options

  • --target-format <format>: target image format

Keywords

image

FAQs

Package last updated on 17 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts