
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@~crazy/keywatch
Advanced tools
按键观察
npm i @~crazy/keywatch -S
import KeyWatch from '@~crazy/keywatch';
const watch = new KeyWatch();
// 监听
const removeListen = watch.listen('ctrl+c', () => {
console.log('复制');
// 返回 true 禁用浏览器默认行为
return true;
});
// 移除
removeListen();
// 全局阻止默认行为
const watch = new KeyWatch(unll, true);
/**
* 组合键
* 先按下 ctrl+k,再按下 ctrl+u
**/
watch.listen('ctrl+k>ctrl+u', () => {
console.log('将文本转换为大写');
return true;
});
// 监听多个
watch.listen(['ctrl+z', 'ctrl+a'], () => {
console.log('撤销');
});
<input id="input" />
const watch = new KeyWatch(document.querySelector('#input'));
// 监听所有按键
watch.listen(event => {
console.log(`按下了${event.key}`);
});
// 是否按下 ctrl 键
console.log(watch.ctrl);
// 是否按下 shift 键
console.log(watch.shift);
// 是否按下 alt 键
console.log(watch.alt);
// 是否按下 meta 键
console.log(watch.meta);
// 判断其他按键
console.log(watch.isPressed('a'));
FAQs
We found that @~crazy/keywatch 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.