cpuabuse-system

System module

Usage no npm install needed!

<script type="module">
  import cpuabuseSystem from 'https://cdn.skypack.dev/cpuabuse-system';
</script>

README

Travis (.com) npm Codecov Codacy grade Libraries.io dependency status for latest release Documentation Chat

About

Related projects

Description

The system handles initialization of data structures using information from yaml files. System is split into multiple extendable modular subsystems, responsible for respective functionality such as file system, error handling, internal system logic, etc.

Setup

Requirements

  • Node.js version 10 and higher

Dependencies

Installation

npm install cpuabuse-system --save

API

TypeScript

// Import
import { Behaviors, ErrorCallback, Options, System } from "cpuabuse-system";

// Init options
let options: Options = {
    id: "my_system",
    initFilename: "init",
    logging: "off",
    relativeInitDir: "my_system",
    rootDir: "root"
};

// Init behaviors
let behaviors: Behaviors = [
    {
        system_load() {
            console.log("done");
        }
    }
];

// Create a system
let mySystem: System = new System({ options, behaviors, onError });

Node.js

// Import
const system = require("cpuabuse-system");

// Init options
let options = {
    id: "my_system",
    initFilename: "init",
    logging: "off",
    relativeInitDir: "my_system",
    rootDir: "root"
};

// Init behaviors
let behaviors = [
    {
        system_load() {
            console.log("done");
        }
    }
];

// Create a system
let mySystem = new system.System({ options, behaviors, onError });