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

@getexeer/saudi-gosi

v1.0.1

Published

Saudi social insurance contributions: pension with the progressive 2024-2029 schedule, SANED and occupational hazards, split by branch and by payer, with the 45,000 SAR monthly wage ceiling. Zero dependencies.

Readme

saudi-gosi

Saudi social insurance contributions — اشتراكات التأمينات الاجتماعية — split by branch and by who pays each one.

Zero dependencies. No build step. Runs in Node 18+ and in the browser.

import { calculateGosi } from "@getexeer/saudi-gosi";

calculateGosi({ wage: 8000, year: 2026 }).total;
// 1880  — 860 from the employee, 1020 from the employer

The rates it implements

Per the Social Insurance Law as amended with effect from 3 July 2024:

| Branch | Employee | Employer | Who it applies to | | --- | --- | --- | --- | | Pension — المعاشات | 9% → 11% | 9% → 11% | Saudis | | SANED — التأمين ضد التعطل | 0.75% | 0.75% | Saudis | | Occupational hazards — الأخطار المهنية | — | 2% | Everyone |

The pension schedule applies to subscribers joining from 3 July 2024 and steps up in half points each year:

| Year | 2024 | 2025 | 2026 | 2027 | 2028 | 2029 | | --- | --- | --- | --- | --- | --- | --- | | Rate, each side | 9% | 9.5% | 10% | 10.5% | 11% | 11% |

A subscriber who joined before that date stays on 9% for as long as the subscription lasts.

Non-Saudi employees are covered by occupational hazards alone: 2%, paid by the employer, with nothing deducted from the employee.

The contribution wage ceiling is 45,000 SAR per month. Anything above it is not contributed on.

Install

npm install @getexeer/saudi-gosi

Usage

import { calculateGosi, NATIONALITY, SUBSCRIBER } from "@getexeer/saudi-gosi";

const r = calculateGosi({
  wage: 8000,
  nationality: NATIONALITY.SAUDI,     // or NATIONALITY.NON_SAUDI
  subscriber: SUBSCRIBER.NEW,         // or SUBSCRIBER.EXISTING
  year: 2026,                         // fixes the pension step for a new subscriber
});

r.base;                        // 8000   — the wage after the ceiling
r.capped;                      // false
r.pension.employee;            // 800
r.pension.employer;            // 800
r.saned.employee;              // 60
r.occupationalHazards.employer;// 160
r.employeeTotal;               // 860
r.employerTotal;               // 1020
r.total;                       // 1880

The rate on its own

import { pensionRate } from "@getexeer/saudi-gosi";

pensionRate({ subscriber: "new", year: 2026 });      // 0.1
pensionRate({ subscriber: "existing", year: 2026 }); // 0.09

A non-Saudi employee

const r = calculateGosi({ wage: 8000, nationality: "non_saudi" });
r.employeeTotal;  // 0
r.employerTotal;  // 160  — occupational hazards only

What this library does not decide

  • Whether a particular person is registered with GOSI at all.
  • Arrears, penalties and late-payment surcharges.
  • Transitional treatment when a subscriber's status changed part-way through a year.
  • Anything about the Saudi employee's entitlement, which is a benefit calculation and not a contribution one.

Those are GOSI's determinations, not arithmetic.

Accuracy notes

  • The published schedule covers 2024 to 2029. A year before it is read as the first step and a year after it as the last, so passing 2023 by mistake charges 9% rather than jumping to 11%.
  • A subscriber from before 3 July 2024 keeps 9% no matter which year is passed.
  • Amounts are rounded to two decimals.
  • The library throws on a wage of zero or less, a non-numeric wage, an unknown nationality, an unknown subscriber type, or a missing year for a new subscriber. It does not quietly return NaN.
  • These rates change by regulation. Check the published schedule before relying on a figure for a real payroll.

TypeScript

Types ship with the package. NATIONALITY and SUBSCRIBER are frozen const objects, so the string arguments are narrowed rather than bare strings, and calculateGosi returns a frozen GosiResult.

Not legal advice

This is an arithmetic library. It encodes a reading of the published contribution rates and nothing more. Verify any figure that will actually be remitted, and confirm current rates with GOSI.

About

This is the calculation behind the free GOSI calculator published by Exeer (إكسير), a Saudi administrative and HR system. It is packaged here so that anyone building payroll software for Saudi businesses can reuse the same rules instead of re-deriving them.

License

MIT © Exeer