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

@lacspace/patterns

v1.0.0

Published

Rule-based chart-pattern detection on OHLCV bars: ATR-sized swings (zigzag), harmonic XABCD patterns (Gartley, Bat, Butterfly, Crab, Cypher, AB=CD) with potential-reversal zones, an Elliott impulse count that obeys the three hard rules, classic chart patt

Readme

@lacspace/patterns

Rule-based chart-pattern detection on OHLCV bars, with no AI. Every detector works from ATR-sized swings, so the same settings suit a 5-minute chart and a weekly one. Results come back drawing-ready (paths, zones, profiles, using bar indices and prices) and as plain data (hits, found).

The patterns describe geometry already on the chart; they are not forecasts or advice. An Elliott count in particular is subjective: this shows one count that obeys the rules.

import { swings, chartPatterns, harmonics, elliott, tpoProfiles } from "@lacspace/patterns";

// bars: { time (unix seconds), open, high, low, close, volume }[]
swings(bars, 2);                // { piv: [{ i, p, hi }], tail, atr }: zigzag confirmed at k × ATR(14)
chartPatterns(bars).found;      // ["Double bottom", "Double bottom", "Range (rectangle)"]
harmonics(bars).hits;           // [{ name: "Gartley", bull, pts: [X,A,B,C,D], forming }]
elliott(bars).paths;            // labelled impulse (0)…(5), then (a)(b)(c); wave-5 target zone
tpoProfiles(bars, 24, 5);       // market profile per session: rows with letters, POC, 70% value area, initial balance

| Function | Finds | |---|---| | swings(bars, k = 2) | Alternating swing highs and lows, confirmed once price moves k × ATR(14). The still-forming extreme is returned as tail. | | harmonics(bars, k, tolPct = 6, show = 3) | Gartley, Bat, Alt Bat, Butterfly, Crab, Deep Crab, Cypher and AB=CD. A pattern still waiting for D gets a potential-reversal D zone. | | elliott(bars, k) | The latest five-wave impulse obeying the three hard rules (wave 2 doesn't retrace past wave 1's start, wave 3 isn't the shortest, wave 4 doesn't overlap wave 1), then a-b-c. A wave-5 target zone is added when waves 1–4 are in place. | | chartPatterns(bars, k = 1.5, look = 200, …, show = 2) | Double tops and bottoms, head & shoulders (and inverse) with necklines, confirmation and measured moves. Also the latest structure: ascending, descending or symmetrical triangle, rising or falling wedge, range, rising or falling channel, or broadening formation. | | tpoProfiles(bars, rows, sessions) | TPO market profile per session: 30-minute letters (hourly letters on hourly bars), POC, value area, initial balance. | | sessionVolumeProfiles(bars, rows, sessions) | Volume-by-price per session, with up and down volume, POC and value area. | | kagi(bars, rev), pointFigure(bars, box, rev = 3) | Time-independent chart transforms. They return ordinary bars plus the shape data. |

Sessions are split by UTC calendar day. That fits exchanges whose trading day doesn't cross UTC midnight; NEPSE's 11:00–15:00 NPT is 05:15–09:15 UTC. Colours are optional trailing parameters.

Watch out for unadjusted corporate-action gaps (bonus or rights issues) in the input. The detectors treat them as real price moves, so adjust your candles first (for example with @lacspace/market).

Contributed by the ShareRocketPro team from their production chart. The tests pin its behaviour on a real NABIL 15-minute snapshot.

Licence

Lacspace Free Licence v1.0: free for personal and commercial use.