
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@yoot/imgix
Advanced tools
Imgix adapter for yoot
Generate Imgix image URLs with a unified, chainable API focused on core transformations.
npm install @yoot/imgix @yoot/yoot
import {yoot} from 'jsr:@yoot/yoot';
import imgix from 'jsr:@yoot/imgix';
<script type="importmap">
{
"imports": {
"@yoot/yoot": "https://cdn.jsdelivr.net/npm/@yoot/yoot/+esm",
"@yoot/imgix": "https://cdn.jsdelivr.net/npm/@yoot/imgix/+esm"
}
}
</script>
<script type="module">
import {yoot} from '@yoot/yoot';
import imgix from '@yoot/imgix';
</script>
import {registerAdapters} from '@yoot/yoot';
import imgix from '@yoot/imgix';
registerAdapters(imgix);
Use the yoot
function to build transformations:
import {yoot} from '@yoot/yoot';
// Without arguments
const preset = yoot();
// With image URL
const preset = yoot('https://assets.imgix.net/...');
// With an object
const preset = yoot({
src: 'https://assets.imgix.net/...',
alt: 'Alt text',
width: 1024, // Optional: intrinsic width
height: 1024, // Optional: intrinsic height
});
const preset = yoot('https://assets.imgix.net/...').width(1024).format('webp');
const transformedUrl = preset.url;
Supports both JSX and HTML rendering via @yoot/yoot/jsx
or @yoot/yoot/html
.
import {yoot} from '@yoot/yoot';
import {defineSrcSetBuilder, getImgAttrs, getSourceAttrs} from '@yoot/yoot/jsx'; // Or '@yoot/yoot/html'
// Define transformation directives
const preset = yoot({
src: 'https://assets.imgix.net/...',
alt: 'Thumbnail',
})
.width(200)
.aspectRatio(1)
.fit('cover');
// Derive <img> attributes
const imgAttrs = getImgAttrs(preset, {loading: 'lazy'});
// Derive <source> attributes
const sourceAttrs = getSourceAttrs(preset, {
type: 'image/webp', // this helper modifies the format to webp
sizes: '200px',
srcSetBuilder: defineSrcSetBuilder({widths: [200, 300, 400]}),
});
return (
<picture>
<source {...sourceAttrs} />
<img {...imgAttrs} />
</picture>
);
// -- presets.ts --
import {yoot} from '@yoot/yoot';
import {defineSrcSetBuilder, withImgAttrs, withSourceAttrs} from '@yoot/yoot/jsx'; // Or '@yoot/yoot/html'
export const thumbnailPreset = yoot().width(200).aspectRatio(1).fit('cover');
// Define the base <source> attributes
export const getThumbnailSourceAttrs = withSourceAttrs({
sizes: '200px',
srcSetBuilder: defineSrcSetBuilder({widths: [200, 300, 400]}),
});
// Define the base <img> attributes
export const getImgAttrs = withImgAttrs({loading: 'lazy'});
// -- Usage --
import {thumbnailPreset, getImgAttrs, getThumbnailSourceAttrs} from '@/presets';
const thumbnail = thumbnailPreset({
src: 'https://assets.imgix.net/...',
alt: 'Thumbnail',
});
// Or thumbnailPreset.src('https://assets.imgix.net/...').alt('Thumbnail');
const imgAttrs = getImgAttrs(thumbnail);
const webpSourceAttrs = getThumbnailSourceAttrs(thumbnail, {
type: 'image/webp', // this helper modifies the format to webp
});
const jpegSourceAttrs = getThumbnailSourceAttrs(thumbnail, {
type: 'image/jpeg', // this helper modifies the format to jpeg
});
return (
<picture>
<source {...webpSourceAttrs} />
<source {...jpegSourceAttrs} />
<img {...imgAttrs} />
</picture>
);
Try it live — zero setup:
Found a bug or wish to contribute? Open an issue or send a PR.
Licensed under the ISC License.
FAQs
Imgix adapter for @yoot/yoot
The npm package @yoot/imgix receives a total of 13 weekly downloads. As such, @yoot/imgix popularity was classified as not popular.
We found that @yoot/imgix demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.