isekai
A Stranger in a Strange Land
Last updated 4 months ago by agoblinking .
AGPL-3.0-or-later · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install isekai 
SYNC missed versions from official npm registry.

logo

build status website dev log source code license discord chat

:WARNING:

Still super early. Use at your own risk.

WHAT IS THIS?

[ISEKAI*ENGINE] is the glue that sticks a bunch of opinionated useful software together and then exposes it as TOML configuration to the end user. Let [DAEMON]s handle the heavy work through [SKILL]s. The end goal is for anyone to be able to easily run their own servers for websites, games, social, chat, email and etc. This lets the end user own their own data and be able to do anything they want with it.

QUICK START

Requires node.js to be installed.

npm install -g isekai

cd my_project
isekai init
isekai start

Your world awaits at http://localhost:8080.

TIPS AND TRICKS

Navigate to http://localhost:8080/admin to play God with your world.

Your DATA directory can override anything in BIN/DATA. Use this to mod graphics and stuff.

BUT WHAT DOES IT DO?

Isekai turns configuration TOML files into executable javascript bundles for either node or the browser.

ex:

[NODE]
[LOG]
[HTTP]
port = 8080

[HTTP_API]
[HTTP_PUBLIC]

# [[HTTP_MD]]
# path = "/"
# file = "README.md"
# template = "default.html

into

import isekai from "isekai";
isekai.SET({"NODE":{},"LOG":{},"HTTP":{"port":8080},"HTTP_API":{},"HTTP_PUBLIC":{}});

import LOG from "../SKILLS/LOG/index.js";
import HTTP from "../SKILLS/HTTP/index.js";
import HTTP_API from "../SKILLS/HTTP_API/index.js";
import HTTP_PUBLIC from "../SKILLS/HTTP_PUBLIC/index.js";

isekai.EQUIP({
    LOG,
    HTTP,
    HTTP_API,
    HTTP_PUBLIC,
});

HTTP adds an express server APP onto the shared object as HTTP. HTTP_PUBLIC then serves a static HTTP website from the bag contents of HTTP_PUBLIC.

HTTP_PUBLIC.js

import express from "express";

export default ({
    HTTP
}) => {
    HTTP.use(express.static(`../DATA/HTTP_PUBLIC`));
};

BUT WHAT DOES IT REALLY DO?

isekai.js

// Stare into the Abyss
const Isekai = ({
    SET: (obj) => 
        Object.entries(obj).
            forEach(([ key, value ]) => {
                Isekai[key] = Isekai[key] || {};
                
                if(typeof value === `function`) {
                    Isekai[key] = Object.assign(value, {
                        ...Isekai[key], 
                        ...value
                    });
                } else {
                    Isekai[key] = Object.assign(Isekai[key], value);
                }
            }),

    EQUIP: (obj) => 
        Object.entries(obj).
            forEach(([ key, fn ]) => {
                Isekai[key] = Isekai[key] || {};
                
                fn(Isekai); 
            })
});

export default Isekai;

Current Tags

  • 0.0.18                                ...           latest (4 months ago)

13 Versions

  • 0.0.18                                ...           4 months ago
  • 0.0.17                                ...           4 months ago
  • 0.0.15                                ...           5 months ago
  • 0.0.14                                ...           5 months ago
  • 0.0.12                                ...           5 months ago
  • 0.0.11                                ...           5 months ago
  • 0.0.9                                ...           5 months ago
  • 0.0.8                                ...           5 months ago
  • 0.0.6                                ...           5 months ago
  • 0.0.5                                ...           5 months ago
  • 0.0.4                                ...           5 months ago
  • 0.0.3                                ...           5 months ago
  • 0.0.1                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 13
Last Day 0
Last Week 0
Last Month 2
Dependencies (26)
Dev Dependencies (9)
Dependents (3)

Copyright 2014 - 2016 © taobao.org |