You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@arextest/arex-node-runner

Package Overview
Dependencies
Maintainers
0
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arextest/arex-node-runner

Arex node-agent-runner

latest
npmnpm
Version
0.0.3-beta.16.7
Version published
Maintainers
0
Created
Source

背景

arex node-agent 中间件启动器

环境

  • node v18
  • npm --registry https://registry.npmjs.org
  • arex-node-agent
  • arextest https://github.com/arextest/arex

内容

  • 包含通过APPID装载平台配置的中间件,自定义js装载等
  • 包含初始化agent逻辑
  • 包含按照APP配置初始化agent 执行频次,启停等

运行方案

  • 安装启动runner npm install @arextest/arex-node-runner -g --registry https://registry.npmjs.org
  • trip npm install @arextest/arex-node-runner@1.0.3-beta.15 --registry http://registry.npm.release.ctripcorp.com
  • 配置环境变量 export AREX_HOST=http://xxx:8093 export APPID=demo01 export INSTRUMENTATIONS=ArexHttpInstrumentation,ArexHttpClientInstrumentation
  • 修改export 让require支持远程npm包 export NODE_PATH=$(npm root -g)
  • 配置启动命令 node --require @arextest/arex-node-runner dist/main.js
  • PM2 方案
    • 支持pm2 fork 模式
      配置参数:--node-args="--require @arextest/arex-node-runner"
    • 支持pm2 cluster多实例模式 配置参数: --interpreter="node" \ --interpreter-args='--require @arextest/arex-node-runner' 案例: `pm2 start ./dist/src/main.js
      --name $appname
      -i 4
      --merge-logs
      --log-date-format="YYYY-MM-DD HH:mm:ss"
      --log /opt/logs/$appid/outerr.log
      --output /opt/logs/$appid/out.log
      --error /opt/logs/$appid/err.log
      --interpreter="node"
      --interpreter-args='--require @arextest/arex-node-runner'

    --node-args="--require @arextest/arex-node-runner" \

exit 0`

通过js参数传递:-- --APPID N$appname --AREX_HOST http://xxx --INSTRUMENTATIONS ArexHttpInstrumentation,ArexHttpClientInstrumentation,ArexMysql2Instrumentation

` NODE_ENV=production pm2 start dist/main.js
-i $instance
--name $appname
--merge-logs
--log-date-format "YYYY-MM-DD HH:mm:ss.SSS"
--log "/opt/logs/$appid/outerr.log"
--output "/opt/logs/$appid/out.log"
--error "/opt/logs/$appid/err.log"
--interpreter-args='--require /opt/nodeapp/node_modules/@arextest/arex-node-runner/dist/index.js'
-- --APPID N$appname --AREX_HOST http://xxx --INSTRUMENTATIONS ArexHttpInstrumentation,ArexHttpClientInstrumentation,ArexMysql2Instrumentation

exit 0 `

参考

  • npm 发布流程
  • 申请权限
  • npm login --registry https://registry.npmjs.org
  • npm publish --registry https://registry.npmjs.org --access=public

FAQs

Package last updated on 12 Feb 2025

Did you know?

Socket

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.

Install

Related posts