UNPKG

charlike

Version:

Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options

25 lines (20 loc) 602 B
/*! * is-child-process <https://github.com/tunnckoCore/is-child-process> * * Copyright (c) 2015-2016 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk) * Released under the MIT license. */ 'use strict' var isArray = require('isarray') var isEmitter = require('is-node-emitter') module.exports = function isChildProcess (val) { return isEmitter(val) && hasOwn(val, 'stdin') && hasOwn(val, 'stdout') && hasOwn(val, 'stdio') && isArray(val.stdio) && val.stdio.length > 0 } function hasOwn (obj, val) { return Object.prototype.hasOwnProperty.call(obj, val) }