Socket
Socket
Sign inDemoInstall

ipx

Package Overview
Dependencies
117
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ipx

[![NPM Vernion](https://flat.badgen.net/npm/v/ipx)](https://www.npmjs.com/package/ipx) [![NPM Downloads](https://flat.badgen.net/npm/dt/ipx)](https://www.npmjs.com/package/ipx) [![Package Size](https://flat.badgen.net/packagephobia/install/ipx)](https://p


Version published
Weekly downloads
255K
decreased by-2.25%
Maintainers
2
Install size
26.3 MB
Created
Weekly downloads
 

Readme

Source

IPX

NPM Vernion NPM Downloads Package Size

High performance, secure and easy to use image proxy based on sharp and libvips.

Usage

Quick Start

You can use ipx command to start server using:

$ npx ipx

The default server directory is the current working directory.

Programatic Usage

You can use IPX as a Connect/Express middleware or directly use ipx api.

import { createIPX, createIPXMiddleware } from "ipx";

const ipx = createIPX(/* options */);
const app = express();
app.use("/image", createIPXMiddleware(ipx));

Examples

The examples assume that a static folder with buffalo.png file is present in the directory where IPX server is running.

Change format to webp and keep other things same as source:

http://localhost:3000/static/buffalo.png?format=webp

Keep original format (png) and set width to 200:

http://localhost:3000/static/buffalo.png?width=200

Resize to 200px using embed method and change format to webp:

http://localhost:3000/static/buffalo.png?embed&format=webp&resize=200

Modifiers

PropertyReferenceExampleComments
width_http://localhost:3000/buffalo.png?width=200
height_http://localhost:3000/buffalo.png?height=200
trimRefhttp://localhost:3000/buffalo.png?trim=100
formatRefhttp://localhost:3000/buffalo.png?format=webpSupported format: jpg, jpeg, png, webp, avif, gif, heif
quality_http://localhost:3000/buffalo.png?quality=50Accepted values: 0 to 100
rotateRefhttp://localhost:3000/buffalo.png?rotate=45
flipRefhttp://localhost:3000/buffalo.png?flip
flopRefhttp://localhost:3000/buffalo.png?flop
sharpenRefhttp://localhost:3000/buffalo.png?sharpen=30
medianRefhttp://localhost:3000/buffalo.png?median=10
gammaRefhttp://localhost:3000/buffalo.png?gamma=3
negateRefhttp://localhost:3000/buffalo.png?negate
normalizeRefhttp://localhost:3000/buffalo.png?normalize
thresholdRefhttp://localhost:3000/buffalo.png?threshold=10
tintRefhttp://localhost:3000/buffalo.png?tint=1098123
grayscaleRefhttp://localhost:3000/buffalo.png?grayscale
animated-http://localhost:3000/buffalo.gif?animatedExperimental

Config

Config can be customized using IPX_* environment variables.

  • IPX_DIR

    • Default: . (current working directory)
  • IPX_DOMAINS

    • Default: []

License

MIT

FAQs

Last updated on 01 Jul 2021

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc