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

@avidys/s-blog

v2.0.0

Published

A blog component built with SvelteKit and Markdown

Readme

@avidys/s-blog

A Svelte blog component with markdown support and filtering by year and category.

Installation

pnpm install @avidys/s-blog
# or
npm install @avidys/s-blog
# or
yarn add @avidys/s-blog

Usage

  1. Create a posts directory in your src folder and add your markdown blog posts.

Each post must start with a frontmatter block like this:

---
title: Getting Started with Web Development
description: Web development is an exciting journey that combines creativity with technical skills.
date: '2025-4-14'
categories:
  - web
  - html
  - css
author: "John Doe"
date: "2022-07-01"
updated: "2023-10-26"
published: true
---

This is the first post, and it's a great one!
...

The title, auhor, and date fields are required; the rest is optional.

  1. Add the markdown plugin to your vite.config.ts:
import { markdownMetadataPlugin } from '@avidys/s-blog/markdownMetadataPlugin';

export default defineConfig({
  plugins: [sveltekit(), markdownMetadataPlugin()]
});
  1. Use the Blog component in your Svelte app:
<script>
  import { Blog } from '@avidys/s-blog';
</script>

<Blog />
  1. The Blog component have some properties that can be passed:
  • theme: light or dark; default is read from the browser environment
  • customColors: custom colors for all elements; default undefined and provided by theme - override theme if exists
  • showReadMoreButton: show button to select a post in the list; default true
  • dataPath: path of the json data generated by md2html; by default it's static/data
  • useImports: read json metadata at build, false true (default) uses fetch (dataPath must be served by websever)
  • numberOfPosts: number of blog card to displayl default=3
  • showSearch: display search card; default=false
  • showYears: display years filter card; default=true
  • showCategories: display categories filter card; default=true
  • showAuthor: display author in blog card; default=true
  • showDate: display date in blog card; default=true
  • showDescription: display description in blog card; default=true

Example:


<!-- Use with default values -->
<Blog />

<!-- Customize display options -->
<Blog 
    theme="dark"
    showSearch={false}
    showCategories={true}
    numberOfPosts={3}
    showAuthor={false}
    showDate={false}
    showExcerpt={false}
    showReadMoreButton={false}
/>

<Blog customColors={{
  textBodyColor: '#222222',
  textSubtitleColor: '#1c1c1c',
  textTitleColor: '#111111',
  backgroundColor: '#123456',
  cardBackgroundColor: '#765432',
  borderColor: '#bdc3c7',
  buttonBackgroundColor: '#3498db',
  buttonBorderColor: '#2980b9',
  buttonDisabledBackgroundColor: '#ffffff',
  buttonDisabledBorderColor: '#bdc3c7',
  activeFilterBackground: '#bdc3c7',
  activeFilterText: '#2c3e50',
  linkColor: '#3498db',
  linkHoverColor: '#2980b9'
}} dataPath='/src/posts' />

Features

  • Reset filter by calling function resetSelections
<script>
  import { Blog } from '@avidys/s-blog';
  import type { BlogPageInstance } from '@avidys/s-blog/types.ts';

  let blogPage: BlogPageInstance;

  function handleReset() {
    if (blogPage) blogPage.resetSelections();
  }
</script>
  
<Blog bind:blogPage={blogPage} />

<div class="reset-container">
    <button class="reset-button" on:click={handleReset}>
        Reset Blog Selections
    </button>
</div>

Build Process

During pnpm build or pnpm dev, the build process:

  1. Converts markdown files from /src/posts to HTML in /static/posts (you may need to create the /static/posts directory)
  2. Generates metadata JSON files in /src/data for each post
  3. Creates author, category and year indexes in /src/data

Alternatively, you can run the md2html script to generate the metadata and HTML files:

pnpm md2html

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Publishing Updates

The build command may update some posts, so you need to commit first and then publish the changes:

pnpm build
git add .
git commit -am "build"
git push -u origin main
pnpm publish --access=public

or more simply use the script update-script.js to update the package.json version, build the project, commit and push to remote repository and publish to npm registry:

node update-package.js

This will:

  1. Show current git status
  2. Update package version
  3. Build the project
  4. Commit and tag changes
  5. Push to remote repository
  6. Publish to npm registry

License

GPL-3 License

Credits