npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@plasosdk/plaso-cpp

v0.1.11

Published

plaso c++ plugin

Readme

plaso-node-plugin

安装

在执行 npm install 时会根据 .npmrc 的参数选择下载预编译的 plaso.node 文件:

plasosdk_plasocpp_platform=[win32|darwin]
plasosdk_plasocpp_arch=[x64|x86]
  • plasosdk_plasocpp_platform 是 win32 会根据 plasosdk_plasocpp_arch 选择 32/64 位文件
  • plasosdk_plasocpp_platform 是 darwin 忽略 plasosdk_plasocpp_arch, 下载文件同时支持 x64/arm64
  • 未设置 .npmrc 根据 os.platform() / os.arch() 选择

本插件提供如下接口:

const plaso = require("./build/Release/plaso.node");

// 禁止触摸屏反馈
plaso.disableFeedback();

// 禁止屏幕捕捉
let w = win.getNativeWindowHandle();
plaso.disableScreenShot(w);
plaso.disableScreenShot(w, true); // Save as above
plaso.disableScreenShot(w, false);

// 检测是否在虚拟机中运行,目前检测 VirtualBox/VMWare
if (plaso.detectVmEnv()) {
  console.log("Found VM!");
}

// 检测录屏软件是否存在,目前检测 Mirillis Action
setInterval(() => {
  if (plaso.detectScreenRecorder()) {
    console.log("Found Mirillis Action!");
  }
}, 1000);

// 设置log目录,用于记录设备相关日志,所以需在渲染进程调用,插件会生成plaso-plugin.log
setLogPath('/Users/plaso')

// DNS 查询, 成功返回IP,失败则IP地址为空,仅调用系统DNS API(getaddrinfo)
dnsQuery("baidu.com", function(name, ip, duration) {
  console.log("查询" + name + ",ip是" + ip + ",耗时" + duration + "毫秒");
});

// DNS 检查,使用域名系统getaddrinfo API返回值和114.114.114.114返回值比较
dnsCheck("["www.plaso.cn\","baidu.com\"]", function(a, b, c) {
    console.log("result:" + a + ", failed domains:" + b + ", details:" + c);
})
// 结果示例:
// result:false, failed domains:["baidu.com"], details:[{"ip":"188.131.209.42","ip-2":"188.131.209.42","name":"www.plaso.cn","time":1.18,"time-2":7.338},{"ip":"220.181.7.203","ip-2":"39.156.70.37","name":"baidu.com","time":0.324,"time-2":5.557}]
// result:true, failed domains:[], details:[{"ip":"188.131.209.42","ip-2":"188.131.209.42","name":"www.plaso.cn","time":1.492,"time-2":13.292},{"ip":"220.181.7.203","ip-2":"220.181.7.203","name":"baidu.com","time":0.361,"time-2":9.401}]

// 设备检测对象DeviceCheck,支持如下接口

// 扬声器相关
listSpeaker(); // 枚举扬声器,返回json数组,每个元素有id和name字段,name用于展示,id用于操作设备
startSpeakerTest(id); // 开启扬声器播放,声音文件已经内置
stopSpeakerTest(); // 关闭扬声器

// 麦克风相关
listMicrophone(); // 枚举扬声器,返回json数组,每个元素有id和name字段
startMicrophoneTest(id, function(v) {
  // 回调函数会返回麦克风音量,值为0-100
});
stopMicrophoneTest(); // 关闭麦克风

// 摄像头相关
listCamera(); // 枚举摄像头,返回json数组,每个元素有id和name字段
startCameraTest(id); // 开启摄像头,此时可用getCameraFrame获取视频帧
stopCameraTest(); // 关闭摄像头
getCameraFrame(frame); // 获取摄像头视频帧,返回0表示成功,1表示视频大小改变需重新申请内存,其它值表示未取到
// frame为js传入的对象,有如下参数
// width - 视频宽
// height - 视频高
// yStride - y行宽
// uStride - u行宽
// vStride - v行宽
// yBuffer - js申请的y内存
// uBffer - js申请的u内存
// vBuffer - js申请的v内存

// 插件提供了plaso-plugin-preview.js封装摄像头预览过程,使用方法参见
// https://gitlab.plaso.cn/schoolui/pc_client/plaso-node-plugin/-/tree/dev_device_check/src/example

// 设备更改通知,收到通知后重新查询设备
setDeviceObserver(function(type) {
  if (type == 0) {
    // audio device changed
  } else if (type == 1) {
    // camera device changed
  }
});

注意:MacOS需要监视主窗口'resized',并再次调用plaso.disableScreenShot(w, true)更新截屏排除区域