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

mirai-core-js

v0.0.2-0

Published

mirai-core wrapper for JavaScript

Downloads

4

Readme

mirai-core-js

mirai-core-js 是一个简单的 mirai Javascript 启动器。他并没有为你提供任何的 mirai额外 的功能,而是提供了一个简单的启动器,你可以基于它方便的来在你的 Node.js 程序中控制 mirai 的命令行版本。

安装

npm install mirai-core-js

或者使用yarn

yarn add mirai-core-js

使用

mirai-core-js 接管了 mirai 的命令行版本的输入输出,以方便你在 Node.js 中控制 mirai的启动、停止、重启、执行控制台命令等操作。

const Mirai = require('mirai-core-js')

const mirai = new Mirai({
    javaPath: path.resolve('./mcl_core/java/bin/java'), // java的路径
    mclPath: path.resolve('./mcl_core'), // mirai 的根目录
    onStatusChange: (status) => {
      console.log(status);
    },
    onOutput: (data: string) => {
      if (!data) return;
    },
});

默认情况下,会自动启动mirai进程, 你可以通过设置配置autoStart: false 然后 通过 mirai.start() 来手动启动mirai进程。

API

mirai.start()

启动mirai进程

mirai.stop()

停止mirai进程

mirai.restart()

重启mirai进程

mirai.exec(command: string)

执行控制台命令, 例如 mirai.exec('/help')

Options

| 参数 | 类型 | 默认值 | 描述 | | --- | --- | --- | --- | | javaPath | string | | java可执行文件的路径 | | mclPath | string | | mirai的根目录 | | autoStart | boolean | true | 是否自动启动mirai进程 | | onStatusChange | function | | mirai进程状态改变时的回调函数 | | onOutput | function | | mirai进程输出时的回调函数 |

License

MIT

作者

CafuChino