
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
next-image-from-file
Advanced tools
A wrapper around next/image that automatically sets width and height.
A wrapper around next/image that automatically sets width
and height
.
This is useful in testing and development-environments where next-image-loader
is not available (e.G. storybook).
It will render a next/image without knowing the width
and height
beforehand by rendering a plain <img>
first, then reading out the image dimensions and replacing the <img>
with next/image.
DO NOT USE THIS IN PRODUCTION It will cause layout shift on two subsequent renders.
// .storybook/preview.js
import * as NextImage from 'next/image'
import NextImageFromFile from 'next-image-from-file'
const OriginalNextImage = NextImage.default
Object.defineProperty(NextImage, 'default', {
configurable: true,
value: NextImageFromFile
})
1.0.1 (2021-10-01)
FAQs
A wrapper around next/image that automatically sets width and height.
We found that next-image-from-file 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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.