tarikcurto.node-terminal

2.0.2 • Public • Published

Welcome to node-terminal

Node-terminal is an open source deploy for execute basic and advanced commands with node JS.

Current version is developed under TypeScript OOP, has support for asynchronous and synchronous process.

Is based in reactive programming with RxJS framework and is able to interact with I/O buffers of session.

Let's go to develop!

  • First, we need node-terminal:
npm install tarikcurto.node-terminal
git clone --branch "2.0.x" https://github.com/tarikcurto/node-terminal.git
  • Next step is import module to JS or TypeScript file:
const CommandService =  require('tarikcurto.node-terminal').CommandService;
import {CommandService} from "tarikcurto.node-terminal";
import {ExecutionService} from "tarikcurto.node-terminal";
import {SessionExecutionService} from "tarikcurto.node-terminal";
  • Instance service:
let commandService = new CommandService();
  • Deploy your query:
let commandService = new CommandService();
commandService.nameCommandService.nameCommandData = {value: "ipconfig"};
commandService.argumentCommandService.argumentCommandData.push({key: "/all"});
  • Execute your query:
let executionService:ExecutionService = commandService.instanceExecution();
let sessionExecutionService: SessionExecutionService = executionService.executeAsync();
  • And finally,subscribe to events of terminal (optional):
sessionExecutionService.mainEventList.subscribeOnCloseSessionEvent((data)=>{
    console.log(data.fullOutput);
});

For bugs

About me

  • I am a passionate developer of 20 years that currently lives in Spain.
  • You can contact me through centro.tarik@live.com!

/tarikcurto.node-terminal/

    Package Sidebar

    Install

    npm i tarikcurto.node-terminal

    Weekly Downloads

    4

    Version

    2.0.2

    License

    Apache-2.0

    Last publish

    Collaborators

    • tarikcurto