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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@akashic/engine-files-reftest-helper

v1.3.0

Published

engine-files-reftestでコンテンツを自動実行するためのライブラリ

Readme

engine-files-reftest-helper

engine-files-reftest-helperは、engine-files-reftestでコンテンツを自動実行させるための補助ツールです。 このツールでできることは以下の通りです。

  • playlogのうち、MessageEventを受け取ってdata.typescenario の時、msg.data.command.name の値に応じて処理を実行します。
    • msg.data.command.namescreenshot の時、スクリーンショットをBASE64でエンコードした文字列を指定された形式で出力します。
      • engine-files-reftest側で、その文字列をデコードして msg.data.command.options.fileName で指定されたファイル名でその画像を保存します。
    • msg.data.command.namefinish の時、engine-files-reftest側にスクリーンショット取得処理の要求を意味する文字列を指定された形式で出力します。
    • msg.data.command.nameinit の時に、以下のように出力形式を指定することができます。
      • msg.data.command.options.outputType: consoleでコンソール出力して、postで任意の HTTP エンドポイントに POST リクエストを送信します。出力形式はデフォルトではコンソール出力になっています。
      • msg.data.command.options.outputUrl:postの時の送信先URLを指定します。
  • コンテンツ側で g.game.external.reftest の以下のプロパティを利用することができます。
    • screenshot: (fileName: string, base64: string) => Promise<Response | void>
      • 指定された画像情報を engine-files-reftest 側でスクリーンショットとして取得します
    • finish: () => Promise<Response | void>
      • engine-files-reftest の実行が終了します
    • getImageDataUrlFromCanvas: () => string
      • この関数を実行した時点でのゲーム画面のスクリーンショットを base64 形式で取得します
    • postConsole: (param: ConsoleApiParameter) => Promise
      • 指定したコマンドの実行ができますが、screenshot()finish() の内部で実行されるので、通常コンテンツ側で利用する必要はありません
    • outputType: OutputType
      • コマンドの出力形式を参照・変更できますが、通常コンテンツ側で利用する必要はありません
    • consoleApiUrl: string
      • コマンド API の URL を参照・変更できますが、通常コンテンツ側で利用する必要はありません

使い方

engine-files-reftestのテスト対象コンテンツのディレクトリで以下のコマンドを実行します。

akashic install @akashic/engine-files-reftest-helper

そのコンテンツのエントリーポイントで以下のコードを追記します

require("@akashic/engine-files-reftest-helper");

ビルド方法

engine-files-reftest-helper はTypeScriptで書かれたjsモジュールであるため、ビルドにはNode.jsが必要です。

npm run build によりビルドできます。

npm install
npm run build

テスト方法

  1. TSLintを使ったTypeScriptファイルのLint
  2. remarkを使ったMarkdownファイルのLint

がそれぞれ実行されます。

npm test

注意事項

本ライブラリはブラウザ上で使うことを想定していますが、IE11等globalThis.fetchが無い環境では正しく動作しませんので、globalThis.fetchが存在する環境で本ライブラリを使用してください。

TODO: globalThis.fetchが無い環境でも動作できるようにする

開発者向け

本ツールの publish について

  • 以下の手順を踏むことで publish が行われます。
    1. package.json の version を更新したコミットを作成
    2. 1 のコミットで master ブランチを更新する
    3. GitHub Actions のリリースワークフローが実行される
  • package-lock.json が原因で publish に失敗した場合は、npm i --before <実行時の7日前の日付(yyyy-mm-dd)> を実行して package-lock.json を更新し、再度 publish 処理を行なってください。

ライセンス

本リポジトリは MIT License の元で公開されています。 詳しくは LICENSE をご覧ください。

ただし、画像ファイルおよび音声ファイルは CC BY 2.1 JP の元で公開されています。