Socket
Socket
Sign inDemoInstall

ipx

Package Overview
Dependencies
118
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
265K
increased by2.12%
Maintainers
2
Install size
37.8 MB
Created
Weekly downloads
 

Changelog

Source

0.5.0 (2021-02-03)

⚠ BREAKING CHANGES

  • rewrite ipx

Features

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

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

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

http://cdn.example.com/static/buffalo.png?format=webp

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

http://cdn.example.com/static/buffalo.png?width=200

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

http://cdn.example.com/static/buffalo.png?embed&format=webp&size=200x300

Modifiers

ModifierArgumentsExampleDescription
swidth, heights_200_300Resize image.
wwidthw_200Change image with.
hheighth_200Change image height.
max-maxPreserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to the width and height specified.
min-minPreserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to the width and height specified.

Config

Config can be customized using IPX_* environment variables.

  • IPX_LOCAL_DIR

    • Default: . (current working directory)
  • IPX_REMOTE_ACCEPT

    • Default: []

License

MIT

FAQs

Last updated on 03 Feb 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc