New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@icon-magic/imagemin-farm

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icon-magic/imagemin-farm

Icon magic image minification farm.

  • 2.4.1-beta.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
5
Weekly downloads
 
Created
Source

@icon-magic/imagemin-farm

A process farm for image minification! Has two main methods exported:

minify(path: string): Promise<Result>

Given a path to a png, jpg, or webp file, minify the file. File will be modified in-place and replaced with the minified version of the file. Spins up os.cpus() - 1 child processes to minify files. Minification tasks are transparently load balanced between processes. Promise will resolve with a Result object of the shape:

interface Result {
  path: 'path-to-file';
  worker: number; // Worker PID of completed task;
  status: {
    // Status across all tasks
    total: number; // Total tasks
    remaining: number; // Remaining tasks
    progress: number; // Task progress between 0 and 1.
    workers: [
      {
        pid: number; // Worker PID
        total: number; // Total tasks for worker
        remaining: number; // Remaining tasks for worker
        progress: number | null; // Task progress of worker between 0 and 1
      }
      // repeats for number of workers...
    ];
  };
}

subscribe(func: (res: ProcessStatus) => void): void

Subscribe a listener to recieve regular updates on process status. Good for updating progress bars. Recieves the status property of the Results object (defined above).

FAQs

Package last updated on 12 Oct 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc