0.5.2 • Published 4 years ago

ipx-client v0.5.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

NPM Vernion NPM Downloads Bundle Size

IPX Client for Node.js and Browser

See IPX for more information.

Install package:

npm i ipx-client
yarn install ipx-client

Import client:

import { img } from 'ipx-client'

const { img } = require('ipx-client')

img() is a factory function to configure base options:

// getImage: (path, opts?, format?) => URL
const getImage = img({
  baseURL = 'https://cdn.example.com',
  basePath = 'uploads',
  opts = [], // Default opts
  format = 'jpg',
  presets: {
    chrome400: {
      format: 'webp',
      opts: { s: ['400', '400']}
    }
  }
})

getImage('posts/ipx.png', { w: 200 }) // => https://cdn.example.com/jpg/w_200/uploads/posts/ipx.png

getImage.chrome400('posts/ipx.png') // => https://cdn.example.com/webp/s_400_400/uploads/posts/ipx.png
0.5.2

4 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago