diff options
author | LinuxWizard42 <computerwizard@linuxmail.org> | 2022-10-12 22:54:37 +0300 |
---|---|---|
committer | LinuxWizard42 <computerwizard@linuxmail.org> | 2022-10-12 22:54:37 +0300 |
commit | 703e03aba33f234712206769f57717ba7d92d23d (patch) | |
tree | 0041f04ccb75bd5379c764e9fe42249fffe75fc3 /node_modules/cross-spawn-windows-exe/README.md | |
parent | ab6e257e6e9d9a483d7e86f220d8b209a2cd7753 (diff) | |
download | FlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.gz FlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.zst |
Added export_allowed file to make repository visible in cgit
Diffstat (limited to 'node_modules/cross-spawn-windows-exe/README.md')
-rw-r--r-- | node_modules/cross-spawn-windows-exe/README.md | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/node_modules/cross-spawn-windows-exe/README.md b/node_modules/cross-spawn-windows-exe/README.md new file mode 100644 index 0000000..0fb5ad0 --- /dev/null +++ b/node_modules/cross-spawn-windows-exe/README.md @@ -0,0 +1,67 @@ +# `cross-spawn-windows-exe` + +> Cross-platform support for running Windows executables via Node.js. + +[](https://github.com/malept/cross-spawn-windows-exe/actions?query=workflow%3ACI) +[](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. |