Socket
Socket
Sign inDemoInstall

is-child-process

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-child-process

Checks whether a value is child process result, which in case is more specific Node.js EventEmitter. Browserify-ready.


Version published
Weekly downloads
47
decreased by-59.48%
Maintainers
1
Install size
38.3 kB
Created
Weekly downloads
 

Changelog

Source

1.0.2 - 2016-03-22

  • Release v1.0.2 / npm@v1.0.2
  • use master branch badge on travis
  • update license year range
  • add test that ensure it return true if stdio: 'inherit' is passed to options on cp.spawn

Readme

Source

is-child-process npmjs.com The MIT License

Checks whether a value is child process result, which in case is more specific Node.js EventEmitter. Browserify-ready.

code climate standard code style travis build status coverage status dependency status

Install

npm i is-child-process --save

Usage

For more use-cases see the tests

var isChildProcess = require('is-child-process')

returns false

var fs = require('fs')
var Dush = require('dush')
var Emitter = require('events').EventEmitter

isChildProcess(fs.createReadStream('package.json')) //=> false
isChildProcess(new Emitter()) //=> false
isChildProcess(new Dush()) //=> false

returns true

var cp = require('child_process')

var spawn = cp.spawn('echo', ['hello world'])
var exec = cp.exec('echo "hello world"')

isChildProcess(spawn) //=> true
isChildProcess(exec) //=> true
  • is-emitter: Check that given value is EventEmitter, not so strict as is-node-emitter.
  • is-node-emitter: Strictly checks that given value is nodejs EventEmitter. It's easy, because his API is in frozen state.
  • is-node-stream: Strictly and correctly checks if value is a nodejs stream.
  • is-request-stream: Check that given value is request stream

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Keywords

FAQs

Last updated on 22 Mar 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc