# totvs-platform-helper

> A library to control TOTVS Plataform executables.

Latest version **2.1.0** (published 2019-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install totvs-platform-helper
pnpm add totvs-platform-helper
yarn add totvs-platform-helper
bun add totvs-platform-helper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2019-02-15 |
| First published | 2016-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 45.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 3 |
| Author | Rogerio Ribeiro da Cruz |
| Maintainers | acacio.egas, alexmmartins, danotto, mansano, rogeriorc |
| Keywords | totvs, appserver, smartclient, tds, tdscli |

## Links

- npm: https://www.npmjs.com/package/totvs-platform-helper
- Repository: https://github.com/TOTVSTEC/totvs-platform-helper
- Homepage: https://github.com/TOTVSTEC/totvs-platform-helper#readme
- Issues: https://github.com/TOTVSTEC/totvs-platform-helper/issues
- npm.io page: https://npm.io/package/totvs-platform-helper

## Dependencies (3)

- [q](https://npm.io/package/q.md) ^1.5.1
- [ini](https://npm.io/package/ini.md) ^1.3.5
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3

## Recent versions

- 2.1.0 (latest) — 2019-02-15
- 2.0.1 — 2019-02-15
- 2.0.0 — 2018-10-15
- 1.1.4 — 2017-10-05
- 1.1.3 — 2017-07-18
- 1.1.2 — 2017-07-18
- 1.1.1 — 2017-07-06
- 1.1.0 — 2017-07-05
- 1.0.4 — 2017-03-14
- 1.0.2 — 2017-03-10
- 1.0.3 — 2017-03-10
- 1.0.1 — 2017-01-31
- 1.0.0 — 2017-01-30
- 0.0.8 — 2017-01-24
- 0.0.7 — 2016-12-19
- … 6 more at https://npm.io/package/totvs-platform-helper/versions

## README

# totvs-platform-helper

> 

## Getting Started



### Class **SmartClient**

### Constructor(directory, executable)

+ **directory** (Type: `String`, Default: `process.cwd()`)

+ **executable** (Type: `String`, Default: `smartclient.exe (windows) or smartclient (linux)`)

```js
var SmartClient = require('totvs-platform-helper/smartclient'),
    sc = new SmartClient('C:\\TOTVS\\bin\\smartclient', 'sc.exe');
```

### Method **run**(options) 
Returns: `Promise`

Execute the SmartClient with the provided options, fulfilling the promise when the program ends.

+ **options** (Type: `Object`)

  A set of key/value pairs that contains the parameters to run the smartclient

  ```js
  var SmartClient = require('totvs-platform-helper/smartclient'),
      sc = new SmartClient('C:\\TOTVS\\bin\\smartclient');

  sc.run({
    program: 'SIGAFAT',
    connection: 'TCP',
    environment: 'ENVIRONMENT'
  })
  .then(function() {
    console.log('SmartClient Finished!');
  });
  ```

+ **options.program** (Type: `String`, Default: `"SIGAFAT"`)

  The "Starting Program"

+ **options.connection** (Type: `String | Object`, Default: `"TCP"`)

  The server connection info.

  Using String to read server address/port from smartclient.ini:
  ```js 
  connection: "TCP"
  ```

  Using Object to define server address/port:
  ```js 
  connection: {
    address: "localhost",
    port: 1234
  }
  ```

+ **options.environment** (Type: `String`, Default: `"ENVIRONMENT"`)

  The Server Environment

+ **options.quiet** (Type: `Boolean`, Default: `true`)

  Supress the application Splash Screen

+ **options.args** (Type: `Array`)

  List of string arguments

---
_Source: https://npm.io/package/totvs-platform-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
