Socket
Socket
Sign inDemoInstall

command-join

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 3.0.0

5

command-join.d.ts

@@ -1,3 +0,4 @@

declare function commandJoin(arg: string | readonly string[]): string;
export = commandJoin;
export declare function joinNix(arr: readonly string[]): string;
export declare function joinWin(arr: readonly string[]): string;
export declare function commandJoin(arg: string | readonly string[]): string;
//# sourceMappingURL=command-join.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const NEEDS_QUOTE = /[\s\\*\?\[\]`$()#<>|&;]/;

@@ -49,2 +50,3 @@ function joinNix(arr) {

}
exports.joinNix = joinNix;
function joinWin(arr) {

@@ -99,2 +101,3 @@ const out = [];

}
exports.joinWin = joinWin;
function commandJoin(arg) {

@@ -112,3 +115,3 @@ if (typeof arg === 'string') {

}
module.exports = commandJoin;
exports.commandJoin = commandJoin;
//# sourceMappingURL=command-join.js.map

2

package.json
{
"name": "command-join",
"version": "2.0.1",
"version": "3.0.0",
"description": "Escape and join command-line arguments, cross-platform.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -14,7 +14,7 @@ # command-join

```javascript
const commandJoin = require('command-join')
```typescript
import { commandJoin } from "command-join"
```
### `commandJoin(arg: Array|String): String`
### `commandJoin(arg: string | string[]): string`

@@ -28,3 +28,3 @@ Escapes each command-line argument and joins them into a string that can then be executed, e.g. via `child_process.exec`.

```javascript
let command = commandJoin(['a', "b\\", "'c"])
const command = commandJoin(['a', "b\\", "'c"])
command

@@ -36,1 +36,9 @@ // output on Windows: a "b\\" 'c

See the tests for more convoluted examples.
## Migrating
**Migrating to v3**:
```diff
- const commandJoin = require("command-join")
+ const { commandJoin } = require("command-join")
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc