npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

js_tgdevice

v0.1.4

Published

Helpers for launching Android and iOS Appium sessions on TestGrid

Readme

js_tgdevice

Helpers for launching Android and iOS Appium sessions on TestGrid using the Appium driver APIs.

Install

npm install js_tgdevice

Usage

Android

const { createAndroidDriver } = require('js_tgdevice');

(async () => {
  const driver = await createAndroidDriver({
    remoteUrl: 'https://poc8.testgrid.io/appium_38007/wd/hub',
    capabilities: {
      deviceName: 'Galaxy S22',
      platformVersion: '14',
      udid: 'R5CT712ZP7E',
      'tg:userToken': 'ochskrxwei4ujverxb8w5jfxj1bgnlsw',
      systemPort: '4007'
    }
  });

  try {
    await driver.get('https://testgrid.io/');
    const title = await driver.getTitle();
    console.log('Android page title:', title);
  } finally {
    await driver.quit();
  }
})();

iOS

const { createIosDriver } = require('js_tgdevice');

(async () => {
  const driver = await createIosDriver({
    remoteUrl: 'https://poc8.testgrid.io/appium_36005/wd/hub',
    capabilities: {
      deviceName: 'iPhone 14',
      platformVersion: '17.5.1',
      udid: '00008110-0008656E3AA3A01E',
      'tg:userToken': 'ochskrxwei4ujverxb8w5jfxj1bgnlsw',
      wdaLocalPort: '3005'
    }
  });

  try {
    await driver.get('https://playwright.dev/');
    const title = await driver.getTitle();
    console.log('iOS page title:', title);
  } finally {
    await driver.quit();
  }
})();

Environment Variables

  • TG_ANDROID_REMOTE_URL, TG_IOS_REMOTE_URL: defaults when remoteUrl is omitted.
  • TG_ANDROID_CAPABILITIES, TG_IOS_CAPABILITIES: JSON payloads merged into platform capabilities.
  • TG_DEVICE_REMOTE_URL: shared fallback for both platforms.
  • APPIUM_REMOTE_URL, APPIUM_REMOTE_CAPABILITIES: shared fallbacks used when platform-specific vars are not present (the helper still reads SELENIUM_REMOTE_URL/SELENIUM_REMOTE_CAPABILITIES for backward compatibility).

Capability Templates

# Android
export APPIUM_REMOTE_URL="https://poc8.testgrid.io/appium_38007/wd/hub"
export APPIUM_REMOTE_CAPABILITIES='{"deviceName":"Galaxy S22","platformVersion":"14","platformName":"android","automationName":"UiAutomator2","udid":"R5CT712ZP7E","tg:userToken":"ochskrxwei4ujverxb8w5jfxj1bgnlsw","systemPort":"4007","uiautomator2ServerLaunchTimeout":"90000"}'

# iOS
export APPIUM_REMOTE_URL="https://poc8.testgrid.io/appium_36005/wd/hub"
export APPIUM_REMOTE_CAPABILITIES='{"deviceName":"iPhone 14","platformVersion":"17.5.1","automationName":"XCUITest","platformName":"iOS","udid":"00008110-0008656E3AA3A01E","tg:userToken":"ochskrxwei4ujverxb8w5jfxj1bgnlsw","wdaLocalPort":"3005"}'

Adjust the device identifiers, ports, and tokens for your environment.