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

@naiv/react-bundler

v0.0.6

Published

Bundle react files into single html output

Readme

NAIV React Bundler

Transform react file sources (tsx) into single html output. This bundler includes TailwindCSS v4 means you can use tailwind class on your react code.

Installation

npm install --save @naiv/react-bundler

Usage

import fs from 'node:fs';
import path from 'node:path';
import { bundleHTML, FileSource } from '@naiv/react-bundler';

async function main() {
  const logoComponent: FileSource = {
    path: 'components/Logo.tsx',
    content: `
import React from 'react';
export function Logo() {
  return (
    <div className="flex items-center space-x-2 bg-white p-3 rounded-full shadow-sm border border-teal-100 mb-6">
      <div className="w-8 h-8 bg-teal-500 rounded-full flex items-center justify-center text-white font-bold">N</div>
      <div className="font-bold text-teal-800">Naiv Modularity</div>
    </div>
  );
}
`
  };

  const entryPointCode = `
import { createRoot } from 'react-dom/client';
import React from 'react';
import { Logo } from './components/Logo';

function App() {
  return <div className='flex flex-col items-center text-teal-600 justify-center min-h-screen bg-teal-50'>
    <Logo />
    <div className="text-5xl font-extrabold mb-6 tracking-tight text-teal-900">Hello Standalone World</div>
    <div className="p-8 bg-white/80 backdrop-blur-md rounded-2xl shadow-2xl border border-white/20 max-w-md text-center">
      <p className="text-lg text-teal-700 leading-relaxed">
        Everything you see here is bundled programmatically into a <span className="font-bold text-teal-600">single HTML file</span>.
      </p>
      <div className="mt-6 flex justify-center space-x-3">
        <span className="px-3 py-1 bg-teal-100 text-teal-700 rounded-md text-sm font-medium">Tailwind v4</span>
        <span className="px-3 py-1 bg-blue-100 text-blue-700 rounded-md text-sm font-medium">esbuild</span>
        <span className="px-3 py-1 bg-purple-100 text-purple-700 rounded-md text-sm font-medium">React</span>
      </div>
    </div>
  </div>;
}

const doc = document.getElementById('root');
if (doc) {
  const root = createRoot(doc);
  root.render(<App />);
}
`;

  const html = await bundleHTML(entryPointCode, [logoComponent]);

  const outputPath = path.resolve(process.cwd(), 'index.html');
  fs.writeFileSync(outputPath, html);
}

main().catch(console.error).finally(() => process.exit(0));

Example code above will produce a single index.html file.