#!/usr/bin/env node import CodePush from 'code-push' const token = '064853a8cdbfb94ed9b62ce30da17f162a1444a0' const androidName = 'ASNFTNGFHP-Android' const iosName = 'ASNFTNGFHP-iOS' const codePush = new CodePush(token) codePush.getDeploymentHistory(androidName, 'Release').then(deployments => { codePush.getDeploymentMetrics(androidName, 'Release').then(metrics => { // console.log(deployments) // console.log(metrics) deployments.forEach(d => { let m = metrics[d.label] if (m) { console.log( `${d.label} active: ${m.active}, downloaded: ${m.downloaded}, failed: ${m.failed}, installed: ${m.installed}` ) codePush.patchRelease } }) }) })