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

@livefolio/yfinance

v0.1.0

Published

Yahoo Finance adapters for @livefolio/sdk v0.4. Node-only DataFeed (yahoo-finance2 historical bars). For browser-safe streaming, see @livefolio/yfinance-browser.

Readme

@livefolio/yfinance

Yahoo Finance DataFeed adapter for @livefolio/sdk v0.4. Wraps yahoo-finance2 to implement the SDK's DataFeed.bars interface — resolves an Asset to a Yahoo symbol, calls the chart endpoint, normalizes the response to v0.4 Bar[] (UTC-midnight timestamps, OHLCV from Yahoo's adjusted-close path), and applies a structural completeness filter that drops in-progress today bars without hardcoding US-market hours. A range-aware in-memory cache deduplicates fetches inside a single backtest.

Pre-1.0 — expect breaking changes. Tracks the SDK's v0.4 surface (@livefolio/sdk@^0.4.0).

Install

npm install @livefolio/yfinance

@livefolio/sdk@^0.4.0 is a peer dependency — install it alongside.

Usage

import { YfinanceDataFeed } from '@livefolio/yfinance';
import { FeatureRuntime, MemoryFeatureCache } from '@livefolio/sdk';

const dataFeed = new YfinanceDataFeed();
const runtime = new FeatureRuntime({
  dataFeed,
  featureCache: new MemoryFeatureCache(),
  range: { from: new Date('2024-01-01'), to: new Date('2024-12-31') },
  freq: '1d',
});

Pass runtime into tactical.fromSpec (or any v0.4 strategy) and the SDK's runBacktest does the rest.

Capabilities

| Capability | Status | Notes | |---|---|---| | bars | OK | Daily (1d) only | | fundamentals | not implemented | Optional on the interface; absent on the instance | | events | not implemented | Optional on the interface; absent on the instance | | Frequencies | 1d only | Other frequencies throw |

Bars are total-return-adjusted. Yahoo's adjclose / close ratio is applied uniformly to OHL on each bar so splits and dividends are baked in across all four price fields (volume stays raw). This keeps high ≥ close ≥ low consistent across corporate-action days and matches the v0.4 spec's accepted fidelity bar. Pairing this adapter with a live broker executor isn't a supported configuration — for live trading, use the broker's own data feed (e.g. a future @livefolio/alpaca exporting both DataFeed and Executor).

Stability

Pre-1.0. The class shape (YfinanceDataFeed) is stable; constructor options may grow additively. Any breaking change to the Bar shape would come from the SDK's Bar type, not from this package.

License

MIT