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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cross-country

v1.2.34

Published

an atomic design system built for personal metrics & lonely forest bathers

Downloads

967

Readme

cross-country

an atomic react component library for personal metrics, simulations, and solo forest bathers

NPM JavaScript Style Guide

Core Tech

  • React (18.02), react-spring & react-hook-form
  • CSS modules & Tailwind CSS compatible
  • D3
  • Storybook 8
  • Typescript 5
  • Vite

Do you pour over your personal stats from Github, Strava or Spotify? Is your year always in review?! By experimenting with code, you can hone your developer skills while exploring subject matter that interests you.

storybook

Install

pnpm i cross-country

Types

All types are included in the library.

Use

import { Column, Row, Paragraph, Table, Chart, Bento } from "cross-country"

NextJS Support

For this third-party library to work within NextJS, there is one change required to import it's single css bundle.

New App Strategy

Edit the app\layout.tsx file to:

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import "cross-country/dist/bundle.css";
import { ScoutProviders } from "./providers/providers";

Old Pages Strategy

Edit the pages_app.js file to:

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import "cross-country/dist/bundle.css";
import { GoogleAnalytics } from "@next/third-parties/google";

Tailwind CSS Support

Each component provides a customClass property where you can supply your own tailwind css classes.

Example Page

By wrapping html, each component is augmented for building accessible experiences across screens. A simple page may look like this:

<Wrapper>
  <Page>
    <Column>
      <Paragraph>
       Hello! I'm a developer with a mix of frontend and backend experience.
      </Paragraph>
      <Metrics keyValuePairs=[{label: "Frontend", value: 75, type: "percent"}, {label: "Backend", value: 25, type: "percent"}] />
    </Column>
  </Page>
  <Wallpaper />
</Wrapper>

Server Side Rendering

Part of my dogfooding process is to use my library on my own site, headwinds.

Initially, I ran into a build error where I had to account for every window and document ensuring that they are not referenced until the UI hits the client. After hunting through my webpack build file, I was ble to eliminate them all, and it now works 100% server side!

Automated Component Creation

pnpm new -- --type organisms --path component-name-here

or

pnpm new -- --type molecules --path component-name-here/sub-component-name-here

You can also scaffold only a story:

pnpm new:story -- --type molecules --path policies/privacy-policy

This will automatically scaffold the component directory creating all the files you will need including the tests and stories folders. It saved you at least 5 minutes if not especially around configuring the story; no more frustrating CSF errors!

Unsplash Config

Before installing, create a cross-country-config-private.js file in your root directory by copying the cross-country-config.js and renaming it.

export const privateConfig = {
  UNSPLASH_API_KEY: 'YOUR-UNSPLASH-KEY',
};

Storybook

While creating components, you can use Storybook

pnpm storybook

Open your browser to http://localhost:6006/

Build the Static Site for Storybook

After running npm run build-storybook, I had to make one change to the iframe.html file in the storybook-static folder.

The bundle.css isn't added so I had to add it manually.

  <link rel="stylesheet" href="./bundle.css" />

Before Publishing Check Types

npx tsc --noEmit

Run changesets

npx changeset
npx changeset version
pnpm publish

Need to run both commands npx changeset only creates the changeset while npx changeset version will then update the package.json

Unit Tests

This library uses Jest & React Testing Library for unit tests.

pnpm test

Publish to NPM

pnpm publish
pnpm login
your-username-not-your-email
your-password
now-your-email
pnpm publish

Deploy to Vercel

pnpm build-storybook
cd storybook-static
vercel --prod

Wiki

License

MIT © headwinds