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

ghost-kernel

v5.0.13

Published

ikagaka ghost kernel

Downloads

57

Readme

ghost-kernel

npm npm license npm download total npm download by month

Dependency Status devDependency Status Travis Build Status AppVeyor Build Status codecov.io Code Climate

イカガカの単一ゴーストに対するベースウェア処理を司るカーネル

Install

npm install ghost-kernel

Usage

node.js(ES2015):

import {Ghostkernel} from 'ghost-kernel';

node.js(ES5):

var ghostKernel = require('ghost-kernel');
var Ghostkernel = ghostKernel.Ghostkernel;

browser:

<script src="ghost-kernel.js"></script>
var Ghostkernel = ghostKernel.Ghostkernel;

設計方針

伺かゴーストの動作は以下のように多くのイベント入力ソースを持ちます。

  • ユーザーのシェルに対するマウス操作
  • ユーザーのキーボード操作
  • 時間経過
  • 他ゴーストからのコミュニケート通信やSSTP通信
  • OSの起動や終了・その他通知など

またそれらに対しての反応を返す色々な出力先を持ちます。

  • SHIORIに情報を伝えたりトーク等を引き出す
  • シェルを描画する
  • インストール・アンインストールなどをする
  • 他ゴーストやその他のものにコミュニケートやSSTP等の通信を送る
  • OSの壁紙などを操作する

この入力と出力の様々な組み合わせでゴーストの機能が実現されています。

個別の機能ごとにこれら組み合わせの処理を独自に管理するととても収拾が付かないことになるため、 lazy-event-router という「イベントルーター」を開発し、イベント駆動な設計となっています。

イベントルーターは「入力イベント」と、入力イベントを受け取り出力操作を行う「アクション」とを結びつける(「ルーティング」する)ものです。

入力イベントを発生させ、あるいは出力操作を受け付ける(イベント入力ソースあるいは出力先となる)外部のステートを持つオブジェクトを「コンポーネント」と呼びます。

「アクション」はステートレスな操作であり、アクションをまとめたものを「コントローラー」といいます。

任意のコンポーネントが発生させたイベントからアクションが実行され、そのアクションがまた任意のコンポーネントを操作するというループになります。

これは入力イベントのみを管理していてで出力操作はアクションの実装任せです。 出力操作までコントロールしていれば雰囲気cycle.jsを感じますが、ステートを持つ外部イベントと決定的に決別することはあまり便利でないと判断し、 中途半端があんばいが良いのではないかというところで落ち着いています。

構成としては

  • index パッケージのエントリポイント
  • GhostKernel 各処理をまとめるカーネルオブジェクト
  • routings ルーティングまとめ
  • components コンポーネント群
  • controllers コントローラー群
  • services コントローラーから使う一連の処理

となっています。

API

API Document

License

This is released under MIT License.