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

next-lite-framework

v1.0.0

Published

A lightweight alternative to Next.js

Readme

Next-Lite Framework

A lightweight, high-performance alternative to Next.js built with esbuild.

Features

  • Fast Builds: Uses esbuild for blazing-fast build times
  • Simple Architecture: Easy to understand and customize
  • File-based Routing: Intuitive routing based on your file structure
  • API Routes: Built-in API route support
  • CSS Modules: First-class support for CSS Modules
  • TypeScript Support: Full TypeScript integration
  • Image Optimization: Automatic image optimization
  • Data Fetching: SWR-like data fetching utilities
  • Hot Module Replacement: Fast refresh during development
  • Small Bundle Size: Optimized for production

Getting Started

Installation

# Create a new Next-Lite project
npx create-next-lite my-app

# Or install in an existing project
npm install next-lite-framework

Create a Page

Create a file in the pages directory:

// pages/index.jsx
import React from 'react';
import { Head } from 'next-lite-framework';

export default function HomePage() {
  return (
    <>
      <Head>
        <title>Home | Next-Lite</title>
      </Head>
      <div>
        <h1>Welcome to Next-Lite!</h1>
        <p>A lightweight alternative to Next.js</p>
      </div>
    </>
  );
}

Create an API Route

Create a file in the pages/api directory:

// pages/api/hello.js
export default function handler(req, res) {
  res.status(200).json({ message: 'Hello from Next-Lite!' });
}

Start Development Server

npx next-lite dev

Build for Production

npx next-lite build

Start Production Server

npx next-lite start

Documentation

Routing

Next-Lite uses file-based routing similar to Next.js:

  • pages/index.jsx/
  • pages/about.jsx/about
  • pages/blog/index.jsx/blog
  • pages/blog/[slug].jsx/blog/:slug

Data Fetching

import { useFetch, useSWR } from 'next-lite-framework';

// Basic data fetching
function Profile() {
  const { data, error, loading } = useFetch('/api/user');
  
  if (loading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;
  
  return <div>Hello {data.name}!</div>;
}

// SWR-like data fetching
function Dashboard() {
  const { data, error, loading, mutate } = useSWR('/api/dashboard', url => 
    fetch(url).then(res => res.json())
  );
  
  return (
    <div>
      <button onClick={() => mutate()}>Refresh</button>
      {/* ... */}
    </div>
  );
}

API Routes

// pages/api/user.js
export default function handler(req, res) {
  const { method } = req;
  
  switch (method) {
    case 'GET':
      res.status(200).json({ name: 'John Doe' });
      break;
    case 'POST':
      res.status(200).json({ message: 'User created' });
      break;
    default:
      res.status(405).json({ message: 'Method not allowed' });
  }
}

CSS Modules

import styles from './Button.module.css';

function Button({ children }) {
  return (
    <button className={styles.button}>
      {children}
    </button>
  );
}

Image Optimization

import { Image } from 'next-lite-framework';

function Avatar() {
  return (
    <Image
      src="/avatar.png"
      alt="User Avatar"
      width={50}
      height={50}
      layout="responsive"
    />
  );
}

Head Management

import { Head } from 'next-lite-framework';

function Page() {
  return (
    <>
      <Head>
        <title>My Page</title>
        <meta name="description" content="Page description" />
        <link rel="icon" href="/favicon.ico" />
      </Head>
      {/* Page content */}
    </>
  );
}

Client-side Navigation

import { Link, useRouter } from 'next-lite-framework';

function Navigation() {
  const router = useRouter();
  
  return (
    <nav>
      <Link href="/">Home</Link>
      <Link href="/about">About</Link>
      <button onClick={() => router.push('/contact')}>Contact</button>
    </nav>
  );
}

Configuration

Create a next-lite.config.js file in your project root:

module.exports = {
  server: {
    port: 3000,
    host: 'localhost'
  },
  build: {
    target: ['es2015'],
    minify: true,
    sourcemap: true,
    outDir: '.next'
  },
  images: {
    domains: ['example.com'],
    deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
    imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
    path: '/_next/image',
    loader: 'default'
  },
  experimental: {
    ssr: false,
    concurrentFeatures: false,
    optimizeCss: false,
    scrollRestoration: false
  },
  env: {
    API_URL: 'https://api.example.com'
  }
};

License

MIT