Run a `pod` subcommand and buffer the output

Usage no npm install needed!

<script type="module">
  import execPod from 'https://cdn.skypack.dev/exec-pod';



NPM version Build Status Coverage Status Dependency Status devDependency Status

Run a pod subcommand and buffer the output like child_process#execFile does

const execPod = require('exec-pod');

execPod('search', ['AWS']).then(output => {
  output; //=> '-> AWSAPIGateway (2.2.7)\n   Amazon Web Services SDK for iOS ...'


Use npm:

npm install exec-pod

and make sure CocoaPods is installed.


const execPod = require('exec-pod');

execPod(subcommand [, args, options])

subcommand: String (one of the pod subcommands to run, e.g. install)
args: Array of strings (arguments passed to the command)
options: Object
Return: Promise instance

It runs the given pod subcommand and returns a Promise instance.

When the command finishes successfilly, it will be fulfilled with the command output.

When it fails to run the command or the command itself fails, it will be rejected with an error.

execPod('install', ['AFNetworking'], {bundleExec: true}).then(output => {
  output; //=> 'Updating spec repo `master` ... '


All child_process#execFile options and bundleExec option (described below) are available.


Type: Boolean
Default: false

true runs the pod command with bundle exec, instead of using globally installed pod.

Related project


Copyright (c) 2015 Shinnosuke Watanabe

Licensed under the MIT License.