New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cp-funcs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cp-funcs

A very limited subset of cp functions I use every day

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

cp-funcs

A very limited subset of cp functions I use every day

Install

npm i cp-funcs

Package on npm

API

  • exec-file
  • exec

exec-file(file, [args], [options])

Execute the file

ArgumentAction
filethe executed file
argsthe list of string arguments
optionsoptional options, default to { maxBuffer: 20971520 }

args can be an Array or a String

The default maxBuffer is 20 Mo instead of 200 ko

result is an object with two properties { stdout, stderr }

The EOF chars \n or \r\n are removed from the returned strings stdout and stderr

const execfile = require('cp-funcs/exec-file')

execfile('echo', ['one', 'two']).then(result => {
  // one two
  console.log(result.stdout)
})

execfile('echo', 'abc def').then(result => {
  // abc def
  console.log(result.stdout)
})

exec(command, [options])

Execute the command

ArgumentAction
commandthe executed command
optionsoptional options, default to { maxBuffer: 20971520 }

The default maxBuffer is 20 Mo instead of 200 ko

result is an object with two properties { stdout, stderr }

The EOF chars \n or \r\n are removed from the returned strings stdout and stderr

const exec = require('cp-funcs/exec')

exec('echo one two').then(result => {
  // one two
  console.log(result.stdout)
})

License

MIT

Keywords

child_process

FAQs

Package last updated on 05 Apr 2017

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