# cross-spawn-windows-exe

> Cross-platform support for running Windows executables

Latest version **1.2.0** (published 2021-07-16) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install cross-spawn-windows-exe
pnpm add cross-spawn-windows-exe
yarn add cross-spawn-windows-exe
bun add cross-spawn-windows-exe
```

## 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.2.0 |
| Published | 2021-07-16 |
| First published | 2020-12-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 3 |
| Unpacked size | 39.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mark Lee |
| Maintainers | malept |
| Keywords | cross-platform, spawn, windows, exe |

## Links

- npm: https://www.npmjs.com/package/cross-spawn-windows-exe
- Repository: https://github.com/malept/cross-spawn-windows-exe
- Homepage: https://github.com/malept/cross-spawn-windows-exe#readme
- Issues: https://github.com/malept/cross-spawn-windows-exe/issues
- Funding: https://github.com/sponsors/malept
- npm.io page: https://npm.io/package/cross-spawn-windows-exe

## Dependencies (3)

- [which](https://npm.io/package/which.md) ^2.0.2
- [is-wsl](https://npm.io/package/is-wsl.md) ^2.2.0
- [@malept/cross-spawn-promise](https://npm.io/package/@malept/cross-spawn-promise.md) ^1.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2021-07-16
- 1.1.0 — 2021-07-03
- 1.0.0 — 2020-12-10
- 0.1.0 — 2020-12-05

## README

# `cross-spawn-windows-exe`

> Cross-platform support for running Windows executables via Node.js.

[![CI](https://github.com/malept/cross-spawn-windows-exe/workflows/CI/badge.svg)](https://github.com/malept/cross-spawn-windows-exe/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/malept/cross-spawn-windows-exe/branch/main/graph/badge.svg)](https://codecov.io/gh/malept/cross-spawn-windows-exe)

Utilizes [`@malept/cross-spawn-promise`](https://npm.im/@malept/cross-spawn-promise) (and by
extension, [`cross-spawn`](https://npm.im/cross-spawn)) to execute Windows executables regardless
of platform.

For all platforms, Node 10 or above is required.

On non-Windows, non-WSL host systems, the following dependencies are required:

- .NET executables: [Mono](https://www.mono-project.com/)
- All other Windows executables: [Wine](https://www.winehq.org/)

## Usage

Using the `cross-spawn-windows-exe` API is similar in terms of function signature to `spawn` in
`@malept/cross-spawn-promise`.

### Running a .NET executable

```javascript
// Note: top-level await exists in Node >= 14.8.0. In earlier versions of Node, please wrap in an
// async function.

const { spawnDotNet } = require("cross-spawn-windows-exe");

await spawnDotNet("./hellodotnet.exe", ["--arg1"]);
```

### Running a Windows executable

```javascript
// Note: top-level await exists in Node >= 14.8.0. In earlier versions of Node, please wrap in an
// async function.

const { spawnExe } = require("cross-spawn-windows-exe");

await spawnExe("./hellowindows.exe", ["--arg1"]);
```

### Normalizing Paths

Executables generally can't handle UNIX-style paths that Windows Subsystem for Linux (WSL) passes
in, since it's a Linux environment. This module provides a function to convert those paths from
UNIX-style to Windows-style (via `wslpath`, which should be installed by default on every WSL
distribution), if the host system is determined to be WSL. For non-WSL environments, this is a
no-op.

```javascript
// Note: top-level await exists in Node >= 14.8.0. In earlier versions of Node, please wrap in an
// async function.

const { normalizePath, spawnExe } = require("cross-spawn-windows-exe");

const normalizedPath = await normalizePath("/tmp/foo");
await spawnExe("./openfile.exe", ["--filename", normalizedPath]);
```

## Legal

This module is licensed under the [Apache License, version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
See `LICENSE` for details.

---
_Source: https://npm.io/package/cross-spawn-windows-exe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
