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

flashalpha

v0.2.1

Published

Official JavaScript/TypeScript SDK for the FlashAlpha options analytics API — gamma exposure (GEX), delta exposure (DEX), vanna exposure (VEX), charm exposure (CHEX), implied volatility, volatility surface, 0DTE analytics, BSM greeks, Kelly criterion, and

Readme

flashalpha

Official JavaScript/TypeScript SDK for the FlashAlpha options analytics API.

Get gamma exposure (GEX), delta exposure (DEX), vanna exposure (VEX), charm exposure (CHEX), implied volatility, volatility surface, 0DTE analytics, BSM greeks, Kelly criterion position sizing, and more — all from a single npm package.

Requires Node.js 18+ (uses the built-in fetch API — zero dependencies).

Installation

npm install flashalpha

Quick Start

import { FlashAlpha } from 'flashalpha';

const fa = new FlashAlpha('your-api-key');

// Gamma exposure for SPY
const gex = await fa.gex('SPY');
console.log(gex);

// Filter by expiration and minimum open interest
const gexFiltered = await fa.gex('SPY', { expiration: '2024-12-20', minOi: 100 });

// BSM greeks
const greeks = await fa.greeks({ spot: 500, strike: 500, dte: 30, sigma: 0.20 });
console.log(greeks);

// Implied volatility from a market price
const iv = await fa.iv({ spot: 500, strike: 500, dte: 30, price: 10.5 });
console.log(iv);

// Live stock quote
const quote = await fa.stockQuote('SPY');
console.log(quote);

Get your API key at flashalpha.com.

All Methods

Market Data

| Method | Description | |--------|-------------| | stockQuote(ticker) | Live stock quote (bid/ask/mid/last) | | optionQuote(ticker, opts?) | Option quotes with greeks. Requires Growth+ | | surface(symbol) | Volatility surface grid (public) | | stockSummary(symbol) | Comprehensive stock summary (price, vol, exposure, macro) |

Historical Data

| Method | Description | |--------|-------------| | historicalStockQuote(ticker, { date, time? }) | Historical stock quotes (minute-by-minute) | | historicalOptionQuote(ticker, { date, time?, expiry?, strike?, type? }) | Historical option quotes |

Exposure Analytics

| Method | Description | |--------|-------------| | gex(symbol, opts?) | Gamma exposure by strike | | dex(symbol, opts?) | Delta exposure by strike | | vex(symbol, opts?) | Vanna exposure by strike | | chex(symbol, opts?) | Charm exposure by strike | | exposureSummary(symbol) | Full exposure summary (GEX/DEX/VEX/CHEX + hedging). Requires Growth+ | | exposureLevels(symbol) | Key support/resistance levels from options exposure | | narrative(symbol) | Verbal narrative analysis of exposure. Requires Growth+ | | zeroDte(symbol, opts?) | Real-time 0DTE analytics. Requires Growth+ | | exposureHistory(symbol, opts?) | Daily exposure snapshots for trend analysis. Requires Growth+ |

Pricing and Sizing

| Method | Description | |--------|-------------| | greeks(opts) | Full BSM greeks (delta, gamma, theta, vega, vanna, charm, ...) | | iv(opts) | Implied volatility from a market price | | kelly(opts) | Kelly criterion optimal position sizing. Requires Growth+ |

Volatility Analytics

| Method | Description | |--------|-------------| | volatility(symbol) | Comprehensive volatility analysis. Requires Growth+ | | advVolatility(symbol) | Advanced analytics: SVI, variance surface, arbitrage detection. Requires Alpha+ |

Reference Data

| Method | Description | |--------|-------------| | tickers() | All available stock tickers | | options(ticker) | Option chain metadata (expirations and strikes) | | symbols() | Currently queried symbols with live data |

Account and System

| Method | Description | |--------|-------------| | account() | Account info and quota | | health() | Health check (public) |

Method Options

gex / dex / vex / chex

await fa.gex('SPY', {
  expiration: '2024-12-20', // filter by expiration date (YYYY-MM-DD)
  minOi: 100,               // minimum open interest filter (gex only)
});

zeroDte

await fa.zeroDte('SPY', {
  strikeRange: 10, // number of strikes around ATM to include
});

exposureHistory

await fa.exposureHistory('SPY', {
  days: 30, // number of calendar days of history to return
});

greeks

await fa.greeks({
  spot: 500,       // underlying price
  strike: 500,     // option strike price
  dte: 30,         // days to expiration
  sigma: 0.20,     // implied volatility (annualized, e.g. 0.20 = 20%)
  type: 'call',    // 'call' or 'put' (default: 'call')
  r: 0.05,         // risk-free rate (optional)
  q: 0.01,         // dividend yield (optional)
});

iv

await fa.iv({
  spot: 500,
  strike: 500,
  dte: 30,
  price: 10.5,   // market price of the option
  type: 'call',
  r: 0.05,       // optional
  q: 0.01,       // optional
});

kelly

await fa.kelly({
  spot: 500,
  strike: 500,
  dte: 30,
  sigma: 0.20,
  premium: 5.0,  // option premium paid
  mu: 0.10,      // expected drift of the underlying (annualized)
  type: 'call',
  r: 0.05,
  q: 0.01,
});

Error Handling

All SDK methods throw typed errors. Catch them individually or catch the base FlashAlphaError.

import {
  FlashAlpha,
  AuthenticationError,
  TierRestrictedError,
  NotFoundError,
  RateLimitError,
  ServerError,
  FlashAlphaError,
} from 'flashalpha';

const fa = new FlashAlpha('your-api-key');

try {
  const data = await fa.gex('SPY');
} catch (err) {
  if (err instanceof AuthenticationError) {
    console.error('Invalid API key — check your credentials.');
  } else if (err instanceof TierRestrictedError) {
    console.error(`Upgrade required. Current: ${err.currentPlan}, Need: ${err.requiredPlan}`);
  } else if (err instanceof NotFoundError) {
    console.error('Symbol not found or no data available.');
  } else if (err instanceof RateLimitError) {
    const wait = err.retryAfter ?? 60;
    console.error(`Rate limited. Retry after ${wait}s.`);
  } else if (err instanceof ServerError) {
    console.error(`Server error (${err.statusCode}): ${err.message}`);
  } else if (err instanceof FlashAlphaError) {
    console.error(`API error (${err.statusCode}): ${err.message}`);
  } else {
    throw err; // unexpected — rethrow
  }
}

Configuration

const fa = new FlashAlpha('your-api-key', {
  baseUrl: 'https://lab.flashalpha.com', // default; override for testing
  timeout: 30000,                        // milliseconds (default: 30000)
});

TypeScript

The SDK is written in TypeScript and ships with full type declarations.

import type {
  GexOptions,
  GreeksOptions,
  IvOptions,
  KellyOptions,
  ZeroDteOptions,
  ExposureHistoryOptions,
} from 'flashalpha';

Related

License

MIT. See LICENSE.