
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
lazy-js-utils
Advanced tools
A collection of lazy-loaded JavaScript utilities for efficient development
English | 简体中文
目前整理了200 左右的常用函数,还在持续更新中...,你的认可是对我最大的鼓励 :hearts:
ref<HTMLElment>
和 onMounted
的使用,可以 script 标签直接调用import {
insertElement,
useEventListener,
useMutationObserver,
useRaf,
} from 'lazy-js-utils'
// 监听container的变化, 你不在需要const container = ref<HTMLElement>
useMutationObserver('#container', (mutationsList, observer) => {
console.log(mutationsList)
})
// requestAnimationFrame
useRaf(
(timestamp) => {
// 每针相隔1s执行
console.log('animationFrame', timestamp)
},
1000,
true /* 只执行一次后被销毁 */,
)
// 注册事件
useEventListener('#container', 'click', () => {
console.log('click')
})
// 插入元素
insertElement('#container', '.content')
// 删除元素
removeElement('.content')
<div id="container"></div>
<div class="content">hello world</div>
npm i lazy-js-utils // 安装
import {
deepCompare
} from 'lazy-js-utils' // 按需引入
FAQs
A collection of lazy-loaded JavaScript utilities for efficient development
The npm package lazy-js-utils receives a total of 83 weekly downloads. As such, lazy-js-utils popularity was classified as not popular.
We found that lazy-js-utils 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.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.