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

hyakunin-isshu

v1.1.0

Published

A simple Node.js module that outputs random or specific poems from the classical Japanese anthology 'Hyakunin Isshu' to the console, including kanji, kana, and author information, with optional emoji decorations.

Downloads

11

Readme

Hyakunin Isshu

A simple Node.js module that outputs random poems or specific poems from the classical Japanese anthology "Hyakunin Isshu" (One Hundred Poems by One Hundred Poets) to the console.

Installation

You can install and use the hyakunin-isshu package via npx. There's no need to install it globally.

npx hyakunin-isshu [options]

Usage

Display a Random Poem

By default, running the command without any options will display a random poem from the anthology.

npx hyakunin-isshu

Example output:

No.01: 秋の田の かりほの庵の 苫をあらみ 我が衣手は 露にぬれつつ 🌾🌙💧
漢字: 秋の田の かりほの庵の 苫をあらみ 我が衣手は 露にぬれつつ
仮名: あきのたの かりほのいほの とまをあらみ わがころもでは つゆにぬれつつ

Display a Specific Poem by Number

You can display a specific poem by passing its number using the --no option.

npx hyakunin-isshu --no 1

Example output:

No.01: 秋の田の かりほの庵の 苫をあらみ 我が衣手は 露にぬれつつ 🌾🌙💧

List All Poems

You can list all the poems in the anthology in a text format using the --list option.

npx hyakunin-isshu --list

Example output:

01: 秋の田の かりほの庵の 苫をあらみ 我が衣手は 露にぬれつつ 🌾🌙💧
02: 春過ぎて 夏来にけらし 白妙の 衣ほすてふ 天の香具山 🌸🌿⛰️
...

List All Poems in JSON Format

You can list all the poems in a JSON format using the --list --json options.

npx hyakunin-isshu --list --json

Example output:

[
  {
    "number": "01",
    "kanji": "秋の田の かりほの庵の 苫をあらみ 我が衣手は 露にぬれつつ",
    "kana": "あきのたの かりほのいほの とまをあらみ わがころもでは つゆにぬれつつ",
    "author": {
      "kanji": "天智天皇",
      "kana": "てんじてんのう"
    },
    "emojis": "🌾🌙💧"
  },
  ...
]

Search Poems by Keyword

You can search for poems that contain a specific keyword in either the kanji or kana text, or the author's name, using the --search option.

npx hyakunin-isshu --search 月

Example output:

No.07: 天の原 ふりさけみれば 春日なる 三笠の山に いでし月かも 🌌🌕⛰️

Show Help

To display help and see all available options, use the --help option.

npx hyakunin-isshu --help

Docker

You can also run the hyakunin-isshu package using Docker. This is useful if you prefer not to install Node.js and the package locally.

Build the Docker Image

First, create a Dockerfile with the following content:

# Use Node.js v20 as the base image
FROM node:20

# Create and set the working directory inside the container
WORKDIR /app

# Install the `hyakunin-isshu` package globally
RUN npm install -g hyakunin-isshu

# Set the default command to execute `npx hyakunin-isshu`
# This allows you to run `npx hyakunin-isshu` directly when you start the container
ENTRYPOINT ["npx", "hyakunin-isshu"]

Then, build the Docker image:

docker build -t hyakunin-isshu-image .

Run the Docker Container

To display a random poem:

docker run --rm hyakunin-isshu-image

To display a specific poem by number:

docker run --rm hyakunin-isshu-image --no 1

To list all poems:

docker run --rm hyakunin-isshu-image --list

To list all poems in JSON format:

docker run --rm hyakunin-isshu-image --list --json

To search for poems by keyword:

docker run --rm hyakunin-isshu-image --search 月

License

This project is licensed under the MIT License.