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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vantage-sh/instances-api-client

v1.0.1

Published

A client for the Vantage Instances API

Readme

Instances API Client for TypeScript

A TypeScript client library for the Vantage Instances API, providing access to cloud instance pricing and specifications for AWS EC2, RDS, ElastiCache, Redshift, OpenSearch, Azure, and GCP.

Features

  • Full type safety with generic service/region types
  • Typed models for all instance types with camelCase attributes
  • Async streaming for large datasets
  • Virtual instances queries with typed column specifications

Installation

npm install @vantage-sh/instances-api-client

Requirements

  • Node.js 18+

Usage

Initialize the client

import { APIV1Client } from "@vantage-sh/instances-api-client";

const client = new APIV1Client("your-api-key");

Get a single instance

// Returns EC2Instance
const ec2 = await client.getGlobalInstance("ec2", "m5.large");
console.log(ec2.instanceType); // "m5.large"
console.log(ec2.vCPU);         // 2
console.log(ec2.memory);       // 8.0

// Returns AzureInstance
const azure = await client.getGlobalInstance("azure", "Standard_D2s_v3");

// China regions
const chinaEc2 = await client.getChinaInstance("ec2", "m5.large");

Get an instance family

// Returns EC2Instance[]
const m5 = await client.getGlobalInstanceFamily("ec2", "m5");
for (const instance of m5) {
    console.log(`${instance.instanceType}: ${instance.vCPU} vCPUs, ${instance.memory} GB`);
}

Stream all instances

// Yields pages of EC2Instance[]
for await (const page of client.getAllGlobalInstances("ec2")) {
    for (const instance of page) {
        console.log(instance.instanceType);
    }
}

Run a virtual instances query

const result = await client.runVirtualInstances({
    service: "ec2",
    region: "us-east-1",
    columns: [
        { key: "instanceType" },
        { key: "vCPU" },
        { key: "memory" },
        { key: "costOndemand", sortDesc: false },
    ],
    globalSearch: "m5",
    costDuration: "hourly",
    pricingUnit: "instance",
    currency: "USD",
});

for (const [instanceType, columns] of Object.entries(result)) {
    console.log(instanceType);
    for (const col of columns) {
        console.log(`  ${col.headerText}: ${col.text}`);
    }
}

Available Services

Global services:

| Service | Return Type | |---------|-------------| | ec2 | EC2Instance | | rds | RDSInstance | | cache | CacheInstance | | redshift | RedshiftInstance | | opensearch | OpenSearchInstance | | azure | AzureInstance | | gcp | GCPInstance |

China region services: ec2, rds, cache, redshift, opensearch

Error Handling

import {
    APIError,
    InvalidRequestError,
    NotFoundError,
    RateLimitExceededError,
    UnauthorizedError,
    UnknownHTTPError,
} from "@vantage-sh/instances-api-client";

try {
    await client.getGlobalInstance("ec2", "invalid-type");
} catch (e) {
    if (e instanceof NotFoundError) console.error("Instance not found");
    else if (e instanceof UnauthorizedError) console.error("Invalid API key");
    else if (e instanceof RateLimitExceededError) console.error("Rate limited");
    else if (e instanceof InvalidRequestError) console.error("Bad request");
    else if (e instanceof UnknownHTTPError) console.error(`HTTP ${e.status}`);
}

Development

# Install dependencies
npm install

# Build
npm run build

# Format
npm run format