othus
TypeScript icon, indicating that this package has built-in type declarations

3.17.22-b-ynrtf56cdeΒ β€’Β PublicΒ β€’Β Published

πŸ’« othus

πŸ†• typescript-based framework

Links: npm, github

πŸ’¬ Differences from express

  • Create an xml grammar from within the typescript file.
  • More detailed information than ever before.
  • Stronger routing than traditional routers.

πŸ“Œ Installation

Run from the shell of the operating system:

$ npm install othus

πŸ“‚ Recommended Directory Structure

index.ts
src/
    components/
        Header.ts
    App.ts

πŸ’Ύ Example

index.ts

import othus from 'othus';

import { App } from './src/App';

othus.render(
    <App path="/" />
);

src/App.ts

import othus from 'othus';

import { Header } from './components/Header';

const cors = () => () => {};

export const App: othus.ITF = {
    middleware: [cors()],
    stateOptions: (option: othus.ITF_stateOptions_option) => option,
    body: (req: othus.ITF_body_req, res: othus.ITF_body_res) => {
        res.state(`text`, `0`);

        const count = (req: othus.ITF_body_req, res: othus.ITF_body_res) => {
            res.state(`text`, res.state(`text`) + 1);
        };
				
        const elements: othus.ITFDoc[] = othus.compile(
            <p className="count">{res.state(`text`)}</p>
            <p className="count-btn" onClick={count}>count</p>
        );

        res.send(elements, req.path);
    }
}

Readme

Keywords

Package Sidebar

Install

npm i othus

Weekly Downloads

1

Version

3.17.22-b-ynrtf56cde

License

Apache License 2.0

Unpacked Size

27.6 kB

Total Files

19

Last publish

Collaborators

  • ice1