
Product
Introducing Custom Pull Request Alert Comment Headers
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
image-wire
A minimalistic, dependency free library to merge multiple images into one.
The specific use case case that led to the making of this library is to be able to create a single image from many for idendity documents upload.
Say you have to upload the recto and verso of your idenditity paper but your backend only accept a single file. This is where image-wire
comes in handy.
=> [a] + [b] = [ab]
# npm
$ npm install image-wire
# pnpm
$ pnpm add image-wire
# yarn
$ yarn add image-wire
import { image-wire } from 'image-wire';
const img = document.querySelector('img');
const input = document.querySelector('input');
input.addEventListener('change', async (e) => {
const { files } = e.target;
const [src, blob] = await image-wire(files, {
direction: 'vertical',
gap: 100,
color: 'red',
});
img.src = src;
uploadImage(blob);
});
Returns: Promise<[string, Blob]>
, a tuple with the newly created img url and a blob ready for upload
image-wire
takes a list of strings (which should be a list of URLs) or a FileList
which is what e.target.files
returns on an input of type file.
Object
List of options to pass as a second argument to image-wire
number
A number indicating the gap (in pixels) between each images.
'horizontal' | 'vertical'
A string indicating in which direction the image are going to be glued together.
string & ('image/jpeg' | 'image/png' | 'image/webp')
A string indicating the image format.
number
A number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp.
string | CanvasGradient | CanvasPattern
A string, canvas gradient or canvas pattern used to fill the background. There is no default.
pnpm install
(you might need to install pnpm first)pnpm dev
localhost:3000
and do your changes to src/image-wire.tsimage-wire
is inspired by it.FAQs
0 dependencies, less than 1kb library to glue images together
We found that image-wire demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.