🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

semver-effect

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semver-effect

Strict SemVer 2.0.0 implementation built on Effect, providing typed parsing, range algebra and version cache services.

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
1.6K
69.97%
Maintainers
1
Weekly downloads
 
Created
Source

semver-effect

npm version License: MIT

Strict SemVer 2.0.0 implementation built on Effect. Every operation returns typed errors through Effect's error channel -- no null, no exceptions, no loose mode.

Features

  • Effect-idiomatic namespaced API (SemVer.*, Range.*) matching Effect's own conventions
  • Strict SemVer 2.0.0 parsing with precise error positions (recursive descent, no regex)
  • Typed error channel for every operation -- handle InvalidVersionError, UnsatisfiedRangeError, and others explicitly
  • Range algebra: intersect, union, subset, equivalence, and simplification
  • Dual-style API: all comparison and matching functions support both pipe and direct call

Installation

npm install semver-effect effect

Quick Start

import { Effect, pipe } from "effect";
import { SemVer, Range } from "semver-effect";

// Direct construction -- no parsing needed
const v = SemVer.make(1, 4, 2);
const next = SemVer.bump.minor(v);            // 1.5.0
pipe(v, SemVer.gt(SemVer.make(0, 9, 0)));     // true

// Parsing strings returns Effect with typed errors
const program = Effect.gen(function* () {
  const version = yield* SemVer.fromString("1.4.2");
  const range = yield* Range.fromString("^1.2.0");

  Range.satisfies(version, range);             // true
  SemVer.gt(version, yield* SemVer.fromString("1.3.0")); // true
  SemVer.compare(version, yield* SemVer.fromString("2.0.0")); // -1
});

Effect.runSync(program);

Documentation

For API reference, Effect integration patterns, migration guides, and SemVer spec compliance details, see docs/.

License

MIT

Keywords

semver

FAQs

Package last updated on 11 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts