UCON is a Node.js super framework for I/O in terminals.
It is designed to make I/O in terminals Visualize, Componentize and Standardize.
As a framework, UCON also provides useful standard components, such as ProgressBar
and Table
etc.
It is also convenient to create a component on your own, because the design of UCON and the features of terminals. The implementation of a component generally does not need to exceed 50 lines.
Developed by UniCoder Group. DESIGNED IN CHINA.
Converts plain text output into a graphic of characters.
Each output can be composed of components.
This borrows from the designs of front-end frameworks.
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. [^1]
In UCON, components are divided into three categories: BlockComponent, InlineComponent and ContainerComponent
BlockComponent
s occupy one or more lines without listening for input.
new
mount
to mount it to the newest linelet pb = new ucon.ProgressBar({
name: "test"
})......
mount
for more than one time may cause undefined behaviorsInlineComponent
s render part of a line according to the arguments.
Call Name([Params][,...Contents])
, which returns an instance.
ucon.ucon.log("This book is ", ucon.Italitic("Harry Potter"), ".");
InlineComponent
, so it cannot be added directly to the string or passed to the methods of standard console
. Please call its render
method to get the pure rendered stringIcon
component,
', but Spaces are not added between arguments, for the same reason as the ucon.log
method, to allow another inline component to be part of contentContainerComponent
s process all the outputs while they are registered.
new
begin
to output the beginning and register itucon.log
end
to unregister it and output the endinglet group = new ucon.Group();
......
ucon.log
method will be processed by ContainerComponent
sregister
/unregister
methods can be called midway to turn processing on/off[TODO]
[^1]: https://reactjs.org/docs/components-and-props.html, Introduction