New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

optipng

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

optipng

The optipng utility as a readable/writable stream

latest
Source
npmnpm
Version
4.2.0
Version published
Weekly downloads
3.5K
-13.76%
Maintainers
1
Weekly downloads
 
Created
Source

node-optipng

NPM version Build Status Coverage Status Dependency Status

The optipng command line utility as a readable/writable stream. This is handy for situations where you don't want to worry about writing the input to disc and reading the output afterwards.

If you don't have an optipng binary in your PATH, node-optipng will try to use one of the binaries provided by the node-optipng-bin package.

The constructor optionally takes an array of command line options for the optipng binary:

var OptiPng = require('optipng'),
  myOptimizer = new OptiPng(['-o7']);

sourceStream.pipe(myOptimizer).pipe(destinationStream);

OptiPng as a web service:

var OptiPng = require('optipng'),
  http = require('http');

http
  .createServer(function (req, res) {
    if (req.headers['content-type'] === 'image/png') {
      res.writeHead(200, { 'Content-Type': 'image/png' });
      req.pipe(new OptiPng(['-o7'])).pipe(res);
    } else {
      res.writeHead(400);
      res.end('Feed me a PNG!');
    }
  })
  .listen(1337);

Installation

Make sure you have node.js and npm installed, then run:

npm install optipng

Releases

Changelog

License

3-clause BSD license -- see the LICENSE file for details.

Keywords

optipng

FAQs

Package last updated on 07 Sep 2022

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