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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@slybridges/kiss

v0.9.0

Published

Keep It Simple and Static site generator

Downloads

165

Readme

😚 kiss: keep it simple and static site generator

Low-tech static site generator

What kiss is

  • Low-tech: VanillaJS, small codebase, little abstractions.
  • Minimal: No framework, no code transpiler, little dependencies.
  • Batteries included: Comes out of the box with everything you need to make an SEO friendly website
  • Developer friendly: kiss start will watch your changes and reload the browser after every build so that you can iterate quickly.
  • Powerful: Dynamic data computations, page data cascade and derived content generation.
  • Extensible: Easily add support for more content types, dynamic computations, writers, post build commands via hooks, etc.

How it works:

  • Write your content in markdown, html, json, or javascript
  • Organize your articles in folders the way you want your urls to look like (like in the good ole days!)
  • Write your site design in Nunjucks and get access to the full site data while doing so
  • Use top-down data cascade to enrich your content metadata as it is crawled
  • Write small functions to compute dynamic data during data cascade (e.g. generate default title based on permalink or default cover image based on content)
  • Create custom pages derived from the main data (e.g list of articles by tags or articles by author's)
  • Pre-compute derived data views based (e.g. compute the list of categories and subcategories for generating the navigation bar)

kiss will automatically make your site SEO friendly by default:

  • Optimize images and make them responsive
  • Data cascade makes it trivial to generate meta and Open Graph tags
  • Generate RSS feed
  • Generate sitemap
  • Generate a dump of your full site as JSON for debug or to implement actions via workers (like site search)

DISCLAIMER

Concept is being tuned until reaching v1. Things might break. Use at your own risk.

Requirements

Node 20 or above.

Quick start

Use the kiss-starter boilerplate to get started in no time: https://github.com/slybridges/kiss-starter

DYI install

npm install --save @slybridges/kiss

Then create a kiss.config.js to set your config.

Default folder structure

Here is how your project directory would look like:

content/                          # this where your source content reside
├── blog/                         # create sub-folders as you see fit to match your site URL structure.
│   │                             # kiss automatically generates folder index pages listing all children
│   ├── my-first-blog-post/       # content piece that is a directory with post.md/.html file inside
│   │   ├── post.md               # generated permalink will be /blog/my-first-blog-post/ (you can override it if you want)
│   │   └── blog-post-cover.jpg   # pictures in content directory are copied as is
│   └── another-blog-post.md      # content piece that is a single file
└── index.js                      # index file data (.js/.md/.html) are merged with parent data and cascade to their children
public/                           # this is where generated static files will be written
theme/                            # this is where you create your site design
└── templates/                    # this is where your nunjucks template live
    ├── default.njk               # default nunjucks template
    ├── collection.njk            # template for collection (index) pages
    └── post.njk                  # template for post (article) pages
kiss.config.js                    # kiss config file
package.json

Launch dev server

npx kiss start

Launches the build, watch for content or config changes and reload the browser after every build.

Generate a production build

NODE_ENV=production npx kiss build

Documentation

Read the code, Luke.

  • Obi-Wan Kenobi, had he been the creator of kiss

kiss codebase is small and easy to navigate:

  • start with config/defaultConfig.js to get an understanding of how you can configure your project.
  • then, head over build.js build() method to understand the lifecycle of a build.
  • finally, head over to data/initialPageData.js and scroll down to the bottom to read about the default page metadata and dynamic computations

Alternatively check out kiss-starter for a real life minimal example.

Troubleshooting

I get a Error: ENOSPC: System limit for number of file watchers reached error on Linux when I run kiss start or kiss watch on my large project

You can increase the limit with the following command:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p