Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@node-kit/extra.cp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-kit/extra.cp

Some shared extra utilities for nodejs build-in child_process modules

  • 3.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@node-kit/extra.cp

Some shared extra utilities for nodejs build-in child_process modules

NPM version Codacy Badge Test coverage npm download License

Sonar

Install

# use pnpm
$ pnpm install -D @node-kit/extra.cp

# use yarn
$ yarn add -D @node-kit/extra.cp

# use npm
$ npm install -D @node-kit/extra.cp

Usage

use import

import { execa, execaSync } from '@node-kit/extra.cp'

execa().then(() => {})

use require

const { execa, execaSync } = require('@node-kit/extra.cp')

execa().then(() => {})

API reference

1. execa & execaSync

make exec behave like execa

  • Usage: execa(file, args, options) & execaSync(file, args, options)
  • Parameters:
ParamDescriptionTypeOptional valueRequiredDefault value
fileThe name or path of the executable file to run.string-true-
argsList of string arguments.ReadonlyArray<string>-false-
optionsOptions for execFileobject-false-
  • Types:
import type {
  ExecFileOptions,
  ExecFileOptionsWithBufferEncoding,
  ExecFileOptionsWithStringEncoding,
  ExecFileSyncOptions,
  ExecFileSyncOptionsWithBufferEncoding,
  ExecFileSyncOptionsWithStringEncoding
} from 'node:child_process'
import type { ObjectEncodingOptions } from 'node:fs'

declare function execa(
  file: string,
  args?: ReadonlyArray<string> | undefined | null,
  options?:
    | ExecFileOptions
    | ((ObjectEncodingOptions & ExecFileOptions) | undefined | null)
    | ExecFileOptionsWithBufferEncoding
    | ExecFileOptionsWithStringEncoding
): Promise<{
  stdout: string | Buffer
  stderr: string | Buffer
}>

declare function execaSync(
  file: string,
  args?: ReadonlyArray<string>,
  options?:
    | ExecFileSyncOptions
    | ExecFileSyncOptionsWithBufferEncoding
    | ExecFileSyncOptionsWithStringEncoding
): string | Buffer
  • Demos:
  1. simple use
import { execa, execaSync } from '@node-kit/extra.cp'

execa().then(() => {})

Issues & Support

Please open an issue here.

License

MIT

Keywords

FAQs

Package last updated on 28 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc