Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Lets your videos be responsive by keeping an intrinsic aspect ratio.
This module is based heavily off of Dave Rupert's FitVids jQuery plugin.
npm install fitvids --save
You can also download the files manually and include them via a <script>
tag.
fitvids() // Bam, done.
The module exports a single function. Just call it, and it'll wrap all your videos. By default it applies to any videos on the page.
If you'd prefer to limit this to a single element, you can call fitvids with an optional selector:
fitvids('.video-container')
By default, fitvids automatically wraps Youtube, Vimeo, and Kickstarter players, but if you'd like it to wrap others too, you can pass them in as selectors via the players
property.
fitvids({
players: 'iframe[src*="example.com"]'
})
Or several at once:
fitvids('.video-container', {
players: ['iframe[src*="example1.com"]', 'iframe[src*="example2.com"]']
})
If there's certain videos you'd like to be ignored, you can pass those in as an option via the ignore
property.
fitvids({
ignore: '.a-special-video'
})
This module uses document.querySelector
which is supported in newer browsers. According to Can I Use, querySelector
has a 94.61% global support rate, so it should be safe for most people.
FAQs
Makes your videos fluid-width.
The npm package fitvids receives a total of 3,537 weekly downloads. As such, fitvids popularity was classified as popular.
We found that fitvids 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.