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

arjun-react-ui-demo

v0.1.1

Published

A beginner-friendly React component library example built for learning npm package publishing.

Readme

arjun-react-ui-demo

A beginner-friendly React component library project built for learning how npm packages work, how reusable React libraries are created, and how publishing and installing packages works.

Project Purpose

This repository is not a normal React app. It is a library package that can be published to npm and installed into other React projects.

  • package.json is configured as a library package, not an application.
  • src/ contains reusable components and shared theme logic.
  • vite.config.ts builds the package in both ESM and CommonJS formats.
  • dist/ is generated after build and contains the ready-to-publish package.

Folder Structure

  • src/components/ - reusable UI components like Button, Card, and Input.
  • src/themes/ - theme definitions and provider logic for light/dark mode.
  • src/hooks/ - helper hooks like useTheme.
  • src/styles/ - simple CSS styles for the components.
  • src/types/ - shared TypeScript types and interfaces.
  • src/index.ts - centralized exports so consumers can import from the package root.

Build Steps

Run:

npm install
npm run build

This creates the dist/ folder. The dist/ folder is the compiled package output that npm will publish.

Why build?

  • src/ uses TypeScript and React JSX.
  • The build step turns that source code into JavaScript that other projects can consume.
  • The package exports both ESM and CommonJS formats for compatibility.
  • Type declarations are generated so TypeScript users get proper autocompletion.

NPM Package Configuration

Key package.json fields

  • name - package name published to npm.
  • version - current package version following semantic versioning.
  • main - CommonJS entry used by Node and some bundlers.
  • module - ESM entry used by modern bundlers.
  • types - TypeScript declaration file entry.
  • exports - controls what files are visible to package consumers.
  • files - limits what files are included when publishing.
  • peerDependencies - tells consumers which versions of React the library expects.

Version Management

This project uses semantic versioning (semver): MAJOR.MINOR.PATCH

  • 0.1.0 - initial release.
  • 0.1.1 - patch release, bug fixes or small improvements.
  • 0.2.0 - minor release, new features without breaking changes.
  • 1.0.0 - major release, breaking changes may be introduced.

Npm will not allow republishing the same version once it has been published, so every release must use a new version.

Publish Guide

  1. Log in to npm:
npm login
  1. Build the package:
npm run build
  1. Publish the package:
npm publish --access public
  1. Update the package version for a new release:
npm version patch
npm version minor
npm version major

Example Consumer Usage

In another React project, install the package:

npm install arjun-react-ui-demo

Then import the components:

import React from 'react';
import { Button, Card, Input, ThemeProvider } from 'arjun-react-ui-demo';

function App() {
  return (
    <ThemeProvider>
      <Card title="Welcome">
        <p>This is a reusable card from the library.</p>
        <Input placeholder="Type here" />
        <Button variant="primary">Click me</Button>
      </Card>
    </ThemeProvider>
  );
}

export default App;

Public vs Private Packages

  • Public package: available to everyone on npm.
  • Private package: only available to your account or organization.
  • Scoped package: starts with @scope/name and can be public or private.

This project is set up as a public package example using a simple public name.

Example Consumer Project Files

A small example consumer app is included in example/App.tsx to show how imports look from a package.


Happy learning! This repository is intentionally simple so you can understand the full package workflow.