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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@xtp-smart/ctp_terminal_info

v0.1.0

Published

对c++开发的CTP看穿式监管进行封装

Downloads

99

Readme

CTP看穿式监管数据采集-Nodejs/Electron版本

对c++开发的CTP看穿式监管进行封装

  • sfit_tst_1.0_20220124_1468
  • sfit_pro_1.0_20220124_1468

install

npm i -D @xtp-smart/ctp_terminal_info

使用

const { createTerminalInfoScanner } = require("@xtp-smart/ctp_terminal_info");

const scanner = createTerminalInfoScanner(true);

function testGetTerminalInfo() {
    scanner.getTerminalInfo((err, buffer) => {
        if (err) {
            console.info("error:", err.message);
        }
        console.log(Buffer.isBuffer(buffer));
        console.log(buffer.length);
        console.log("buffer:", buffer);
        console.log("ctpApi采集的终端信息如下:", buffer.toString("base64"));
    });
}

function testGetApiVersion() {
    console.info("getApiVersion:", scanner.getApiVersion())
}

testGetTerminalInfo();
testGetApiVersion();

API

createTerminalInfoScanner(isEvaluateEnv)

创建一个硬件信息扫描器

  • isEvaluateEnv: <boolean> - 是否为测评环境,默认为false

  • return: Scanner

Scanner类

属性:env

  • <string>: "evaluate", "prod"

方法: getTerminalInfo(cb)

异步获取终端信息

  • cb: (err: Error, buffer: Buffer) => void - 回调函数,可选,如果传入cb,则使用cb函数处理获取到的终端信息,方法返回值为undefined; 如果没有传入cb,则方法在成功时有返回值,在失败抛出Error

  • return: Promise

使用cb处理返回值时,如果err为空,则获取成功;否则获取失败。

方法: getApiVersion()

同步获取ctp库版本号

  • return: string

使用注意事项

在同一个进程中,无法同时使用