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

liuyao

v0.3.0

Published

Offers metadata for the Chinese Liu Yao divination, sourced from works such as 'Zeng Shan Bu Yi'.

Readme

liuyao

Metadata and utility classes for Chinese Liu Yao divination. This package provides typed models for yao lines and hexagrams, along with traditional metadata derived from sources such as Zeng Shan Bu Yi.

For more packages, see my homepage.

Features

  • Create a yao from its Yang-count representation, quaternary or various arguments.
  • Build a hexagram from six Yao lines or from a known hexagram name.
  • Inspect hexagram metadata such as its name, palace, phase, and setup information.
  • Derive the changed hexagram for dynamic lines.
  • Access Six God ordering data for different heavenly stems.

Skill Pack

This packages includes a 'liuyao-skill' directory that can parse a hexagram string and date into a structured JSON output. It is used for agents to divination and interpretation. See the SKILL.md for details.

I tried it, very handy.

Installation

pnpm add liuyao

Quick Start

import { Hexagram, Yao, SixGodList } from 'liuyao';

const hexagram = Hexagram.fromQuaternary('111222'); // gets a Hexagram instance of '地天泰'

if (hexagram === null) {
	throw new Error('Invalid hexagram');
}

console.log(hexagram.info.id);
console.log(hexagram.toDescriptionEn());
console.log(hexagram.toChanged()?.info.id);
console.log(SixGodList[0]);

Core Concepts

Yao

A yao is one line in a hexagram. The constructor accepts a yang count from 0 to 3:

  • 0: old yin, dynamic
  • 1: young yang, static
  • 2: young yin, static
  • 3: old yang, dynamic

Example:

import { Yao } from 'liuyao';

const yao = new Yao(3);

console.log(yao.name);
console.log(yao.symbol);
console.log(yao.isDynamic);

Hexagram

A hexagram contains six yao lines ordered from bottom to top.

import { Hexagram } from 'liuyao';

const qian = Hexagram.fromId('乾为天');

if (qian) {
	console.log(qian.info.sign);
	console.log(qian.info.phase);
	console.log(qian.dynamicInner);
}

Useful instance members:

  • info: metadata for the current hexagram
  • isDynamic: whether any line is dynamic
  • isChanged: whether the current hexagram is already a changed hexagram
  • toChanged(): returns the changed hexagram when dynamic lines exist
  • toDescription(): Chinese description
  • toDescriptionEn(): English description

Useful factory methods:

  • Hexagram.fromYaos(yaos)
  • Hexagram.fromYangCounts(counts)
  • Hexagram.fromId(id)
  • Hexagram.fromPalace(palace)

Exported API

The package currently exports:

Classes:

  • Hexagram
  • Yao

Data Lists:

  • HexagramList(六十四卦): Includes 64 static hexagram info objects with traditional metadata.
  • HexagramYaoIndex(六十四卦爻位名)
  • TrigramList(八卦): Includes 8 static trigram info objects with traditional metadata.
  • SixGodList(六神表)

Types:

  • type SixGod
  • type SixGodInfo
  • type SetupGramInfo

Notes

  • Traditional names and metadata values are kept in Chinese.
  • The package focuses on data modeling and lookup. It does not implement a full divination workflow by itself.

License

MIT