Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@ued2345/octopus-util
Advanced tools
├── build
│ ├── build.js // 执行打包 npm run build
│ └── webpack.conf.js // webpack配置文件
├── dist
│ ├── octopus.min.js // 打包后的文件,也是被其它项目引入的文件
├── src
│ ├── device
│ │ │── getBrowser.ts // 获取操作系统类型
│ ├── jsbrige
│ │ │── init // 二级目录
│ │ │ │── bridge.ts // 定义类型
│ │ │ └── brigeInit.ts // 创建bridge对象
│ │ └── jsBrige.ts // export jsbridge方法
│ └── index.ts // webpack打包入口文件
├── .babelrc // babel配置文件
├── tsconfig.config.js // ts配置文件
├── README.md // 项目说明文档
第一步:npm run build
第二步:npm发包
octopus = {
// 获取操作系统类型
getBrowser: () => {
android: boolean,
gecko: boolean,
iPad: boolean,
iPad: boolean,
iPhone: boolean,
ios: boolean,
mobile: boolean,
presto: boolean,
qq: boolean,
trident: boolean,
webApp: boolean,
webKit: boolean,
weixin: boolean,
wpApp: boolean,
},
// 通过userAgent 判断是否在APP内
getInApp: (uName) => {return boolean},
// JsBridge 与原生通信
JsBridge: {
// js调用webview事件
callHandle: ({method, params}, callback) => {},
// webView调用JS事件
registerHandle: (method, callback) => {},
},
// cookie 操作
setCookie: (name, value, days) => {},
getCookie: (name) => {},
delCookie: (name) => {}
}
npm install --save-dev @ued2345/octopus-util
<script src="octopus.min.js"></script>
<script>
var browser = octopus.getBrowser()
</script>
import * as octopus from '@ued2345/octopus-util'
const browser = octopus.getBrowser()
// 或单独引用方法
import {getBrowser} from '@ued2345/octopus-util'
FAQs
ued2345 utils
The npm package @ued2345/octopus-util receives a total of 4 weekly downloads. As such, @ued2345/octopus-util popularity was classified as not popular.
We found that @ued2345/octopus-util demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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.