
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
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 126 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.