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

hikarujs

v1.21.1

Published

A static site generator that generates routes based on directories naturally.

Downloads

136

Readme

Hikaru

A static site generator that generates routes based on directories naturally.

npm-version npm-downloads node-version github-license

Install

Hikaru is a command line program (not a module) and you can install it from NPM, since Hikaru v1.14.0, it is recommended to install it locally in your site dir and run it with npx:

$ npm i -s hikarujs && npx hikaru i

Hikaru works on Node.js v18.12.0 LTS or later.

Setup site

$ mkdir hikaru-site && cd hikaru-site
$ npm install --save hikarujs hikaru-generator-feed hikaru-generator-sitemap hikaru-generator-search
$ npx hikaru init --debug

Install theme

Clone theme

Using hikaru-theme-aria as example:

$ git clone https://github.com/AlynxZhou/hikaru-theme-aria.git themes/aria

Or if you want commit the whole site you can use submodule:

$ git submodule add https://github.com/AlynxZhou/hikaru-theme-aria.git themes/aria

Edit config

$ $EDITOR site-config.yaml

Set themeDir to themes/aria:

themeDir: themes/aria

Copy theme config to site dir and edit it:

$ cp themes/aria/theme-config.yaml theme-config.yaml
$ $EDITOR theme-config.yaml

Create src file

Edit file

$ $EDITOR srcs/my-first-post.md

Add front matter

---
title: My First Post
created: 2018-08-08T09:27:00
layout: post
---

Add content

Some content...

<!--more-->

# This is my first post!

Start live server

$ npx hikaru serve --debug

Build static files

$ npx hikaru build --debug

Contribute

If you want to contribute, please follow my coding style.

Most things can be fixed by standardx and custom eslint rules, so please run npm test before commit, and use npx standardx --fix bin/* hikaru/*.js tests/*.js to fix most problems, and fix remaining problems that cannot pass tests manually.

I'll list personal flavors that cannot be handled by eslint here. If some things are not listed, follow existing code.

Arrays, Objects or Sets, Maps

If we have some simple types and we want to exclude same elements, just use Set.

If we want a dictionary to store keys and values, and keys are not fixed, just use Map.

Otherwise, use Arrays and Objects, for example lists, queues or dictionaries that have fixed keys.

If we got parsed Objects and Arrays, for example options from YAML files or data from JSON files, don't convert them into Maps and Sets except we need to do other operations on them.

for...of, for...in, .forEach(), .map()

If we are not only doing some operations to array elements but also caring about their return values, just use .map().

If we just do some opeartions to array elements but not caring about return values, don't use .map().

If we are iterating Objects, use for...in.

Otherwise, use for...of.

Never use .forEach() unless you cannot use for...of, they are almost the same and we learn for in the first coding lesson so why not for?

class or .prototype

I just prefer class.

Common JS or ES Module

I personally like Common JS, but more and more libraries uses ES module, so use ES module.

More

Docs: https://hikaru.alynx.one/

Repo: GitHub

Default theme ARIA: hikaru-theme-aria

My blog built with Hikaru and ARIA: 喵's StackHarbor

License

Apache-2.0