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

ca-child-support-guideline

v0.1.0

Published

Zero-dependency TypeScript library implementing California's statewide child support guideline formula (Family Code section 4055).

Readme

ca-child-support-guideline

A small, zero-dependency TypeScript library implementing California's statewide uniform guideline formula for child support, set out in California Family Code section 4055.

Given each parent's net monthly income, the parents' timeshare split, and the number of children, it returns the guideline monthly support amount and which parent owes it.

What this is (and is not)

This library implements the core arithmetic formula from Family Code 4055. It does not model every input a California court actually uses to calculate a final support order, such as:

  • tax filing status and applicable deductions
  • mandatory retirement or union dues
  • health insurance premiums
  • hardship deductions
  • add on costs like childcare or uninsured medical expenses (Family Code section 4062)

California courts use certified calculation software (for example the Judicial Council's DissoMaster or XSpouse, and free public tools like the California Department of Child Support Services online calculator) to produce the official, presumptively correct guideline figure for a case. This library is for education, estimation, and prototyping. It is not legal advice, and the number it returns may differ from what a court would order once every statutory input is accounted for. County local rules and judicial discretion also affect real outcomes. If you need a figure for an actual case, consult a licensed California family law attorney or use a certified calculator.

The formula

Family Code section 4055 sets the statewide guideline as:

CS = K x [HN - (H%)(TN)] x child count multiplier

Where:

  • TN is the combined net monthly disposable income of both parents.
  • HN is the higher earning parent's net monthly income.
  • H% is the higher earning parent's percentage of time with the children (their physical timeshare).
  • K is an income scaled factor derived from TN, described below.
  • The child count multiplier scales the one child amount up for additional children (1.0 for one child, 1.6 for two, 2.0 for three, and so on up through ten).

The K factor and the built in low income adjustment

K is derived from an income factor that changes with combined net income TN:

  • TN at or below $800: the factor is 0.2 + TN / 16000. This is the statute's built in low income adjustment: it scales down gently as combined income approaches zero instead of applying the flat rate used at moderate incomes.
  • TN from $800 to $6,666: the factor is a flat 0.25.
  • TN from $6,666 to $10,000: the factor is 0.1 + 1000 / TN.
  • TN above $10,000: the factor is 0.12 + 800 / TN.

K itself then adjusts for whether the higher earner has majority or minority timeshare: when the higher earner's timeshare H is below 50%, K = (1 + H) x factor; otherwise K = (2 - H) x factor.

All net income and result amounts are monthly dollar figures.

Install

This package is not yet published to npm (see Roadmap below). Until then, install directly from GitHub:

npm install github:hayleyhenning90/ca-child-support-guideline

Or clone it and build locally:

git clone https://github.com/hayleyhenning90/ca-child-support-guideline.git
cd ca-child-support-guideline
npm install
npm run build
npm test

Usage

import { calculateGuidelineSupport } from "ca-child-support-guideline";

const result = calculateGuidelineSupport({
  parentANetMonthlyIncome: 5000,
  parentBNetMonthlyIncome: 3000,
  parentATimesharePercent: 50,
  numberOfChildren: 1,
});

console.log(result);
// { monthlySupportAmount: 338, payingParent: "A" }

calculateGuidelineSupport accepts:

| field | type | notes | | --- | --- | --- | | parentANetMonthlyIncome | number | Parent A's net monthly income in dollars, after taxes and mandatory deductions. | | parentBNetMonthlyIncome | number | Parent B's net monthly income in dollars, on the same basis. | | parentATimesharePercent | number | Parent A's percentage of the children's time, 0 to 100. Parent B is assumed to have the remainder. | | numberOfChildren | number | Whole number of shared children, 1 or more. |

It returns:

| field | type | notes | | --- | --- | --- | | monthlySupportAmount | number | Guideline monthly support, rounded to the nearest dollar. Floored at 0. | | payingParent | "A" | "B" | null | Which parent owes support, or null if the guideline amount is 0. |

The lower level incomeFactor(totalNetMonthlyIncome) function and the CHILD_SUPPORT_MULTIPLIERS table are also exported if you want to inspect or reuse the pieces of the formula directly.

Testing

Tests run with vitest and cover the flat income band, the low income adjustment band, the tapering bands above $6,666 and $10,000 combined income, minority versus majority timeshare for the higher earner, both parents as the higher earner, multiple children, and zero/edge case inputs.

npm test

Used in production

This library's formula is used in production by the free Virdix California Child Support Calculator: https://virdix.co/tools/california-child-support-calculator

Virdix (https://virdix.co) is a California divorce document preparation service.

Roadmap

  • Publish to npm as ca-child-support-guideline (not yet done; no package has been published as of this writing).
  • Optional CLI wrapper.

License

MIT. Copyright (c) 2026 Virdix. See LICENSE.

Disclaimer

This library and its README are provided for educational purposes. They do not constitute legal advice and do not create an attorney client relationship. California child support outcomes depend on facts and figures this formula does not capture, and on the court's discretion. For an authoritative calculation or advice about a specific case, consult a licensed California family law attorney or use certified court software.