
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
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 79 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 now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.