1.0.1 • Published 6 years ago
@genericst/rtl v1.0.1
Runtime Library
A library that provides bootstrap functionality and process management tools for JavaScript applications.
It allows to extend and Application class and implement the main function in JavaScript.
Installation
- Run
npm installto install dependencies - Run
npm buildto build .ts files into .js - Run
npm linkto create a temporary link to library cli
If you have a troubles with that commands try to run withsudo.
How to use
Syntax
$ rtl [options]
Command Line Arguments
-f: select file-o: push arguments to application
Run
- Run with rtl (default):
rtl -f demo.js - Run with node (custom):
node ./bin/cli.js -f demo.js
Demo
const { Application } = require('./rtl-components');
class Demo extends Application {
static main(args) {
const { argv } = process;
console.dir({ argv, args });
}
}
module.exports = Demo;Requirements
- Entry class must be extended of
Application - Entry class must be exported from the file
Mainmust be a static function- Only
use strict, imports/exports, global variables and classes allowed in the file
Scripts
npm start- build and run application with rtlnpm test- run testsnpm run-script rtl-run- run application with rtlnpm run-script build- build .ts files into .jsnpm run-script eslint- check for syntax mistakes