# @suchipi/femver

> Lightweight alternative to semver, supporting absolute versions only

Latest version **1.0.0** (published 2022-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @suchipi/femver
pnpm add @suchipi/femver
yarn add @suchipi/femver
bun add @suchipi/femver
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-02-23 |
| First published | 2022-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Lily Scott |
| Maintainers | suchipi |
| Keywords | semver, light, small, semantic, version, versioning, compare, comparison, parse |

## Links

- npm: https://www.npmjs.com/package/@suchipi/femver
- Repository: https://github.com/suchipi/femver
- Homepage: https://github.com/suchipi/femver#readme
- Issues: https://github.com/suchipi/femver/issues
- npm.io page: https://npm.io/package/@suchipi/femver

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-02-23

## README

# @suchipi/femver

> Lightweight alternative to semver, supporting absolute versions only

The [semver npm package](https://www.npmjs.com/package/semver) is big, weighing in at 88.2 kB (with one dependency, weighing 53.9 kB).

It's big because it has a lot of features, like:

- Matching versions against ranges and patterns
- Coercing vague versions into semver strings
- Identifying the minimum/maximum version of a range
- Cleaning version-like strings into semver strings

These features are great; they're what power npm and let us specify version ranges in our `package.json`s.

However, if you only need to compare two version strings, like so:

```js
const semver = require("semver");

semver.gte(process.version, "8.0.0");
```

Then pulling in all of semver is a little unnecessary.

That's where `@suchipi/femver` comes in; it's a lightweight alternative to `semver`, which _only_ supports comparing absolute versions (eg `1.2.0`, not `>= 1.0.0`).

## API

```ts
/**
 * Reports whether `version` is a valid (absolute) semantic version string.
 */
export function isValid(version: string): boolean;

/**
 * Parses `version` into an object containing major, minor, and patch properties.
 */
export function parse(version: string): {
  major: number;
  minor: number;
  patch: number;
};

/**
 * Returns whether `firstVersion` is less than `secondVersion`.
 */
export function lt(firstVersion: string, secondVersion: string): boolean;

/**
 * Returns whether `firstVersion` is less than or equal to `secondVersion`.
 */
export function lte(firstVersion: string, secondVersion: string): boolean;

/**
 * Returns whether `firstVersion` is greater than `secondVersion`.
 */
export function gt(firstVersion: string, secondVersion: string): boolean;

/**
 * Returns whether `firstVersion` is greater than or equal to `secondVersion`.
 */
export function gte(firstVersion: string, secondVersion: string): boolean;

/**
 * Returns whether `firstVersion` is equal to `secondVersion`.
 */
export function eq(firstVersion: string, secondVersion: string): boolean;
```

## Example

```js
const femver = require("@suchipi/femver");
// or:
// import * as femver from "@suchipi/femver";

femver.gte(process.version, "8.0.0");
```

## License

MIT

---
_Source: https://npm.io/package/@suchipi/femver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
