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

dave-sitegen

v2.16.1

Published

Sitegen is a dead simple static site generator, using React. It does one thing:

Downloads

7

Readme

sitegen(1)

Sitegen is a dead simple static site generator, using React. It does one thing:

  • Take .html.jsx files and spit out .html files. That's it

But, you can customize it a bit, and there are a couple built in components.

Why

I wanted a simple thing to make my personal website (davecode.me), so I made it myself. No fancy build settings, giant build times, huge libraries bundled in. With sitegen, what is thrown in is thrown out.

Install

$ npm install dave-sitegen

Usage

  • sitegen - Runs sitegen on the current folder.
  • sitegen file.html.jsx - Runs sitegen on only file.html.jsx.
  • sitegen -w - Runs sitegen in watch mode.
  • sitegen -p - Preview the output file.html.jsx
  • sitegen -d - Develop Mode

Components

built in

import Sitegen from 'sitegen';
// or
import { version, Title } from 'sitegen';
  • version - library version.
  • useCurrentFile - returns the current file.
  • useScriptTag - lets you embed client-side javascript and take in variables from the build step, js is minified.
  • useRawScriptTag - appends a raw script to the document
  • useId - returns a random string.
  • Title - set the document title, shorthand for react-helmet
  • StyleInjector - adds inline css, and minifies it. OR extracts the css to a hash based filename and adds a lazy load script.
  • Raw - include raw html.
  • createSSRPortal - replacement for React DOM Portals.
  • useController - weird thing, lets you add "singleton" components.
  • IGNORE - Add Sitegen.IGNORE to ignore running this file.
  • root - Relative Path to Root.
  • hook - raw hook data.
  • addDependency - add a depending file (should not be needed as this is auto done)
  • removeDependency - remove a depending file (should not be needed as this is auto done)
  • addShallowDependency - changing the file directly causes update, but recursion chains are not allowed. used to help make the DSVFooter

davecode.me components

Only available when developing the text content for davecode.me.

import Tooltip from 'components/Tooltip';
  • AccessDenied - creates a https://davecode.me/access-denied
  • Block - blocked out / censored
  • Color - Color, uses a context.
  • InlineStyles - a themable css template by passing in some colors
  • LongDash - The "—" Symbol
  • Meta - Meta Tags
  • ModifyCharacters - DSV: Character Style Overrides
  • SubHeader - A sub header, for page dates
  • TerminalCommands - Some Terminal Commands
  • Tooltip - the hover tooltips
  • WarningHeader - Big red warning box.