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

create-next-blog-ai

v0.1.7

Published

CLI tool to scaffold Next-Blog-AI blog pages in a Next.js project

Readme

create-next-blog-ai

CLI tool to easily set up Next-Blog-AI in your Next.js project. This tool scaffolds blog pages with Next-Blog-AI integration.

Usage

npx create-next-blog-ai

This will:

  1. Check if you're in a valid Next.js project
  2. Detect if your project uses TypeScript or JavaScript
  3. Create blog list and blog post pages in your Next.js project
  4. Add the next-blog-ai package as a dependency
  5. Set up your API key in .env.local (if provided)

Options

npx create-next-blog-ai --help

Available options:

  • -y, --yes: Skip all prompts and use default values
  • -d, --directory <path>: Specify the Next.js project directory (default: current directory)
  • -p, --path <path>: Custom path for blog pages (default: app/blog)
  • -a, --api-key <key>: Next-Blog-AI API key
  • -t, --typescript: Force generate TypeScript code
  • -j, --javascript: Force generate JavaScript code

Example with options:

npx create-next-blog-ai --path app/content/blog --api-key your_api_key_here --typescript

Language Support

The tool automatically detects whether your project is using TypeScript or JavaScript and generates code accordingly. You can override this detection with the --typescript or --javascript flags.

Generated Files

The tool will automatically detect your project structure (src-based or flat) and create the following files:

For src-based projects:

src/
├── app/blog/             # Or custom path specified with --path
│   ├── page.tsx          # Blog list page (or .jsx for JavaScript projects)
│   ├── layout.tsx        # Blog layout component (or .jsx for JavaScript projects)
│   └── [id]/             # Dynamic route for blog posts
│       └── page.tsx      # Blog post detail page (or .jsx for JavaScript projects)
├── app/
│   └── sitemap.ts        # Dynamic sitemap for SEO (or .js for JavaScript projects)
└── lib/
    └── blog-api.ts       # API client setup (or .js for JavaScript projects)

For flat structure projects:

app/blog/                 # Or custom path specified with --path
├── page.tsx              # Blog list page (or .jsx for JavaScript projects)
├── layout.tsx            # Blog layout component (or .jsx for JavaScript projects)
└── [id]/                 # Dynamic route for blog posts
    └── page.tsx          # Blog post detail page (or .jsx for JavaScript projects)

app/
└── sitemap.ts            # Dynamic sitemap for SEO (or .js for JavaScript projects)

lib/
└── blog-api.ts           # API client setup (or .js for JavaScript projects)

How It Works

The generated code uses the Next-Blog-AI package's HTML format to render blog content with minimal setup:

  1. API Client Setup: Initializes the Next-Blog-AI client with your API key
  2. Blog List Page: Fetches and displays your blog posts with proper metadata
  3. Blog Post Page: Dynamically renders individual blog posts with SEO optimization
  4. Dynamic Sitemap: Generates a sitemap with all blog posts for improved search engine indexing

The HTML format simplifies implementation, as all content (including styling, comments, and related posts) is pre-rendered by the service.

Requirements

  • Next.js project (App Router)
  • Node.js >= 14.0.0

Getting an API Key

Visit Next-Blog-AI to sign up and get an API key.

Learn More

License

MIT