# execute-command-sync

> Execute console commands synchronously in Node.js.

Latest version **1.0.2** (published 2018-04-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install execute-command-sync
pnpm add execute-command-sync
yarn add execute-command-sync
bun add execute-command-sync
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-04-04 |
| First published | 2018-03-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | allnulled |
| Keywords | sync, exec |

## Links

- npm: https://www.npmjs.com/package/execute-command-sync
- Repository: https://github.com/allnulled/execute-command-sync
- Homepage: https://github.com/allnulled/execute-command-sync#readme
- Issues: https://github.com/allnulled/execute-command-sync/issues
- npm.io page: https://npm.io/package/execute-command-sync

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-04-04
- 1.0.1 — 2018-03-14
- 1.0.0 — 2018-03-14

## README

# execute-command-sync


## 1. Introduction

This is a module for Node.js that will let you run console commands redirecting the input, output and error streams, directly to the console, and also in synchronous code.

## 2. Installation

Download the repository from NPM. To do it, type from the command line:

~$ `npm install -s execute-command-sync`

Import in your code the module:

```js
const executeCommand = require("execute-command-sync");
```

## 3. Usage

Start using the command like this:

```js
  executeCommand("ls -lA", {cwd:"/"});
  // You can do things here after the execution has finished
  // The results will be logged in the console
```

Take into account that the output, the error and the input streams are not catchable. To do this, there are more advanced packages out there, like this one: [exec-plan](https://github.com/ryan-self/exec-plan).

## 4. Conclusion

This module is just a wrapper for this answer at StackOverflow:

[Use child_process.execSync but keep output in console](https://stackoverflow.com/questions/30134236/use-child-process-execsync-but-keep-output-in-console#answer-31104898)

Thanks to the great developers that are on StackOverflow, helping every day to do our life a bit easier. Their wisdom is always an honor.

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