explaingit

mumuy/relationship

Analysis updated 2026-07-03

3,708JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A JavaScript library that calculates the correct Chinese kinship title for any family relationship, supporting natural-language queries, reverse lookup, and regional dialect variations.

Mindmap

mindmap
  root((relationship))
    What it does
      Chinese kinship calculator
      Title lookup
      Reverse lookup
    Query modes
      Structured options object
      Natural language sentence
    Features
      Regional dialects
      Custom term overrides
      Reverse lookup
    How to use
      Browser script tag
      npm install
      Live demo site
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Look up the correct Chinese title to use for a specific relative like mom's mom's brother

USE CASE 2

Build a family tree app that automatically displays the right kinship term for each relative in Chinese

USE CASE 3

Support regional dialect differences in Chinese family terms by loading a custom northern or southern mode

USE CASE 4

Reverse-lookup what family chain produces a kinship title like 表哥 to explain it to a non-native speaker

What is it built with?

JavaScriptNode.js

How does it compare?

mumuy/relationshipjin-yufeng/mp-htmlauduno/headtrackr
Stars3,7083,7083,707
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasymoderate
Complexity2/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Not specified in the explanation.

In plain English

This is a JavaScript library that calculates Chinese kinship terms. In Chinese family culture, every relative has a specific title that depends on which side of the family they are on, how many generations apart they are, and their gender. The rules are intricate enough that many adults get confused when visiting extended family. This library does the calculation for you: you describe the relationship in plain Chinese, and it returns the correct title to use. You can ask it questions in two ways. The first is a structured options object where you provide a relationship path (for example, "mom's mom's brother"), specify your own gender, and choose whether you want to know what you should call that person or what they would call you. The second is a natural-language sentence, like asking "how should my dad's mom address my wife?" and getting back the answer. The library also supports a reverse lookup: give it a title like "表哥" and it will explain the family chain that produces that relationship. Regional differences are built in. Northern and southern China use different words for many of the same relatives, and the library lets you define custom modes to match local conventions. You load a named set of overrides for the terms that differ in your dialect, and the calculator uses those instead of the defaults. The library runs in a browser (via a script tag) or in a Node.js project (via npm install as relationship.js). There is a live demo site where you can try it interactively without writing any code. The source includes a data table that maps relationship chains to titles, and the project wiki explains how the algorithm works for developers who want to understand or extend it.

Copy-paste prompts

Prompt 1
I'm building a Chinese family tree app in JavaScript and need to display the correct kinship title for each relative. Show me how to install relationship.js and call it with a relationship path like mom's brother.
Prompt 2
Show me how to use relationship.js to answer the natural-language question: how should my dad's mom address my wife?
Prompt 3
I want to support southern Chinese kinship terms in my app using relationship.js. How do I load a regional dialect mode?
Prompt 4
How do I use the reverse lookup feature in relationship.js to take a title like 表哥 and get back the family chain that produces it?
Prompt 5
Walk me through adding relationship.js to a browser project via a script tag and showing the kinship term for a relationship on the page.

Frequently asked questions

What is relationship?

A JavaScript library that calculates the correct Chinese kinship title for any family relationship, supporting natural-language queries, reverse lookup, and regional dialect variations.

What language is relationship written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js.

What license does relationship use?

Not specified in the explanation.

How hard is relationship to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is relationship for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub mumuy on gitmyhub

Verify against the repo before relying on details.