2.0.2 • Published 7 years ago

tarikcurto.node-terminal v2.0.2

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
7 years ago

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!