code: function _osxPs() {
    const fieldsInfo = _.map({user: 'user', pid: 'pid', ppid: 'ppid', cmd: 'comm', full_cmd: 'command'}, (value, key) => {
      return {name: key, specifier: value};
    });
  
    // Parsing OS X version of ps seems very complicated, you cannot specify a separator
    // but specifying a header is possible. So we will specify a well known header pattern and
    // read each column size to be able to parse the rest
    const spacerLength = 100;
    const spacer = '_'.repeat(spacerLength);
    const specifiersArg = _.map(fieldsInfo, e => `${e.specifier}=${spacer}`).join(',');
  
    let firstLine = true;
    const sizes = [];
    return _ps(['wwaxo', specifiersArg], line => {
      // Use the first line (the header) to calculate all columns length
      if (firstLine) {
        const re = new RegExp(`(${spacer} *)`, 'g');
        let match = null;
        /* eslint-disable no-cond-assign */
        while ((match = re.exec(line)) !== null) {
          const field = match[1];
          sizes.push(field.length);
        }
        /* eslint-enable no-cond-assign */
        if (sizes.length !== fieldsInfo.length) throw new Error('Cannot parse ps output');
        firstLine = false;
        return null;
      }
  
      const process = {};
      let startIdx = 0;
      // Split the line using the column sizes
      _.each(sizes, (size, index) => {
        const value = line.slice(startIdx, startIdx + size).trim();
        startIdx += size;
        const key = fieldsInfo[index].name;
        process[key] = value;
      });
      return process;
    });
  }
docs: /* ISTANBUL_IGNORE_IF_NOT_OSX