
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@loyalvalleycapital/monitor
Advanced tools
如果通过一些其他工具配置了安装源,那么
--registry
参数可以忽略
# npm
npm install @loyalvalleycapital/monitor --registry=xxxxx
# yarn
yarn add @loyalvalleycapital/monitor --registry=xxxx
目前打出 2 个版本的 js,一个包含
UserAgent
库的,一个不包含的(为了减少包体积,概况可以减少33kb),默认指向不包括的UserAgent
。如果需要引入包含UserAgent
的 js,需要配置下 webpack 别名:
{
alias: {
// ...other alias
monitorsdk: 'monitorsdk/dist/monitorsdk-web.js',
}
}
import monitor, { setCustomError } from ' @loyalvalleycapital/monitor'
monitor.trackEv(...)
setCustomError(err, {code: 'xxx', custom: {}})
用法跟之前相同,因为抽取成 npm 包的形式复用,所有有些参数必须通过外部传递进来。 以下几点需要注意:
Promise
捕获,希望每个项目有不同的错误码,所以在初始的时候monitor.init()
,传入一个projectErrCode
参数:monitor.init({
projectErrCode: 'ERR020000',
其他选项,
// ...
})
wrapperRequest
这个 redux 中间件里把请求的错误都抛出了,所以在使用的时候,通过setCustomError
把相关的一些错误信息配置到error对象
上,方便全局统一捕获import { setCustomError } from "@loyalvalleycapital/monitor";
.catch(error => {
next({
type,
payload: {
error,
loading: false,
status: 'failure',
params,
},
});
if (errorCallback) errorCallback();
// 这里
setCustomError(error, {
code: 'ERR02000002',
custom: payload
})
return Promise.reject(error);
)
上面的错误码只是示例,具体的项目可以自定义,定义的时候可以在这里维护下
FAQs
A log lib for RN and web project
The npm package @loyalvalleycapital/monitor receives a total of 2 weekly downloads. As such, @loyalvalleycapital/monitor popularity was classified as not popular.
We found that @loyalvalleycapital/monitor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.