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

@teyuto/docusaurus-plugin-json-export

v0.8.3

Published

A Docusaurus plugin to export content as JSON files

Downloads

11

Readme

Docusaurus JSON Export Plugin

This plugin exports your Docusaurus content as JSON files, making it easy to use your content in other applications or static site generators. It provides flexible options for content export, including support for tags, authors, and pagination.

Installation

npm install @teyuto/docusaurus-plugin-json-export

Usage

Add the plugin to your docusaurus.config.js:

module.exports = {
  // ... other config here
  plugins: [
    [
      '@teyuto/docusaurus-plugin-json-export',
      {
        exportPaths: ['blog'],
        outputDir: 'json',
        paginationSize: 9,
        sortBy: 'date',
        sortOrder: 'desc'
      }
    ],
  ],
};

Options

  • exportPaths: Array of paths to export (default: ['blog'])
  • paginationSize: Number of items per page for paginated lists (default: 10)
  • includeDrafts: Whether to include draft posts (default: false)
  • outputDir: Directory to output JSON files (default: 'json-output')
  • minifyOutput: Whether to minify the JSON output (default: false)
  • sortBy: Field to sort by (default: 'date')
  • sortOrder: Sort order, 'asc' or 'desc' (default: 'desc')
  • includeTagsList: Whether to include a list of all tags (default: true)
  • includeAuthorsList: Whether to include a list of all authors (default: true)
  • defaultImage: Default image URL to use if not specified in frontmatter
  • excludedTags: Array of tags to exclude from export
  • customFields: Object of custom fields to include in each post
  • enablePagination: Whether to create paginated list files (default: true)
  • defaultImagePath: Base path for relative image URLs
  • excludeEmptyContent: Whether to exclude posts with empty content (default: true)
  • authorFallback: Fallback author object if not specified (default: { name: 'Unknown Author', title: 'Contributor' })

Output

The plugin will generate JSON files in the specified output directory:

  • Individual post files: {outputDir}/{exportPath}/{slug}.json
  • Full list file: {outputDir}/{exportPath}/list.json
  • Paginated list files: {outputDir}/{exportPath}/list-{pageNumber}.json
  • Tags file: {outputDir}/{exportPath}/tags.json
  • Authors file: {outputDir}/{exportPath}/authors.json

Post JSON Structure

Each individual post JSON file will have the following structure:

{
  "slug": "post-slug",
  "title": "Post Title",
  "seo_title": "SEO Title",
  "seo_description": "SEO Description",
  "date": "2023-09-20",
  "date_readable": "20 Sep 2023",
  "excerpt": "Post excerpt...",
  "image": "image-url",
  "tags": ["tag1", "tag2"],
  "prefix": 1,
  "author": {
    "name": "Author Name",
    "title": "Author Title",
    "url": "Author URL",
    "image_url": "Author Image URL"
  },
  "content": "HTML content...",
  "content_md": "Markdown content..."
}

Tags JSON Structure

The tags.json file will have the following structure:

[
  {
    "id": "tag1",
    "count": 5,
    "posts": [
      {
        "title": "Post Title",
        "slug": "post-slug"
      },
      // ... more posts
    ]
  },
  // ... more tags
]

Authors JSON Structure

The authors.json file will have the following structure:

[
  {
    "id": "author1",
    "name": "Author Name",
    "title": "Author Title",
    "url": "Author URL",
    "image_url": "Author Image URL",
    "count": 10,
    "posts": [
      {
        "title": "Post Title",
        "slug": "post-slug"
      },
      // ... more posts
    ]
  },
  // ... more authors
]

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.