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

tickerterm

v1.0.2

Published

Node.js library for TickerBot trading and market data

Readme

TickerTerm Node.js Library

⚠️ Breaking Changes (2025-10-25): ticker.history() renamed to ticker.bars() and ticker.quote() removed. See CHANGELOG.md

A Node.js library that provides programmatic access to TickerBot's trading and market data APIs. This library mirrors the same API available in the TickerBot web platform for server-side applications.

Installation

npm install tickerterm

Authentication

This library requires authentication via the TickerTerm CLI. You must install and authenticate with the CLI before using this library.

1. Install TickerTerm CLI

# Installation via npm (when published)
npm install -g tickerterm-cli

# Or install locally in your project
git clone <tickerterm-cli-repo>
cd cli && npm install && npm link

2. Authenticate

# Login with email/password (production)
tickerterm login --email

# Login with Google OAuth (production)
tickerterm login --google

# For TickerTerm employees (staging)
tickerterm login --email --staging
tickerterm login --google --staging

3. Verify Authentication

tickerterm whoami

Quick Start

import { tt, portfolio, ticker, utils, TA } from 'tickerterm';

async function example() {
  try {
    // Get portfolio balances
    const balances = portfolio.balances();
    console.log('Portfolio equity:', balances.equity);

    // Get ticker price
    const price = await ticker.price('AAPL');
    console.log('AAPL price:', price);

    // Place an order
    await portfolio.order('AAPL', 'buy', 'market', { qty: 10 });

    // Log something to TickerBot
    await tt.log('Order placed successfully');

  } catch (error) {
    if (error.message.includes('Authentication required')) {
      console.error('Please run "tickerterm login" first');
    } else {
      console.error('Error:', error.message);
    }
  }
}

example();

API Reference

TT Module

import { tt } from 'tickerterm';

// Logging and notifications
await tt.log(message);
await tt.send_email(to, subject, body);
await tt.create_toast(message, color?);

// State management
await tt.set_state(name, value);
const value = await tt.get_state(name);
await tt.delete_state(name);

// Watchlists
await tt.set_watchlist(name, tickers);
const tickers = await tt.get_watchlist(name);
await tt.delete_watchlist(name);

// AI queries
const result = await tt.ai(returnType, prompt, data?, model?);

Portfolio Module

import { portfolio } from 'tickerterm';

// Portfolio data
const balances = portfolio.balances();
const positions = await portfolio.get_positions();
const position = await portfolio.get_position('AAPL');

// Orders and trades
await portfolio.order('AAPL', 'buy', 'market', { qty: 10 });
await portfolio.close_position('AAPL');
await portfolio.cancel_all_orders();

// Account history
const orders = await portfolio.get_orders();
const transactions = await portfolio.get_transactions();

Ticker Module

import { ticker } from 'tickerterm';

// Market data
const snapshot = await ticker.get('AAPL');
const price = await ticker.price('AAPL');
const bars = await ticker.bars('AAPL', '1d', { start: new Date('2024-01-01') });

// Fundamentals
const financials = await ticker.financials('AAPL');
const dividends = await ticker.dividends('AAPL');

// Chart annotations
await ticker.create_trendline('AAPL', 'support', {
  price0: 150, price1: 160,
  date0: '2024-01-01', date1: '2024-01-10'
});

Utils Module

import { utils } from 'tickerterm';

// Market timing
const isOpen = utils.is_market_open();
const minutesUntilClose = utils.get_minutes_until_close();
const lastMarketDay = utils.get_last_market_day();

Technical Analysis Module

import { TA } from 'tickerterm';

// Moving averages
const sma = TA.SMA.calculate({ values: prices, period: 20 });
const ema = TA.EMA.calculate({ values: prices, period: 20 });

// Oscillators
const rsi = TA.RSI.calculate({ values: prices, period: 14 });
const macd = TA.MACD.calculate({
  values: prices,
  fastPeriod: 12,
  slowPeriod: 26,
  signalPeriod: 9
});

// Volume indicators
const obv = TA.OBV.calculate({ close: prices, volume: volumes });

Error Handling

All functions will throw errors if:

  1. You're not authenticated via the CLI
  2. Your authentication token has expired
  3. API requests fail
try {
  const price = await ticker.price('AAPL');
} catch (error) {
  if (error.message.includes('Authentication required')) {
    console.error('Please run "tickerterm login" first');
  } else if (error.message.includes('token has expired')) {
    console.error('Please run "tickerterm login" to re-authenticate');
  } else {
    console.error('API error:', error.message);
  }
}

Development Status

🚧 This library is currently in development

All functions are implemented as boilerplate and will throw "Not yet implemented" errors. The authentication system is fully functional and will ensure you're properly logged in via the CLI.

Environment Support

  • Production: Default environment for all users
  • Staging: Available only for @tickerterm.com and @tickerbot.io email addresses

The library automatically uses the same environment you authenticated with via the CLI.

Requirements

  • Node.js >= 14.0.0
  • TickerTerm CLI installed and authenticated

License

MIT