Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@mapado/image-url-builder
Advanced tools
npm install "@mapado/image-url-builder"
or with yarn:
yarn add "@mapado/image-url-builder"
import { buildUrl } from '@mapado/image-url-builder';
const imagePath = '2018/01/foo.jpg';
const fullWidthImage = buildUrl(imagePath);
// will output something like '//img.mapado.net/2018/01/foo.jpg'
You can also specify a width
and a height
to crop / resize the image:
const width = 400;
const height = 300;
const cropedImage = buildUrl(imagePath, width, height);
// will output something like '//img.mapado.net/2018/01/foo_thumbs/400-300.jpg'
If you don't want to resize or apply any filter but want to allow webp
format for compatible browser, you have two options:
allowwebp: 1
0
const webpAllowedImage = buildUrl(imagePath, null, null, {allowwebp: 1});
const alsoWebpAllowedImage = buildUrl(imagePath, 0, 0);
// will both output something like '//img.mapado.net/2018/01/foo.jpg_thumbs/0-0.jpg'
FAQs
Build mapado image in JS
The npm package @mapado/image-url-builder receives a total of 0 weekly downloads. As such, @mapado/image-url-builder popularity was classified as not popular.
We found that @mapado/image-url-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.