# unalias

> Alias resolver

Latest version **0.2.4** (published 2023-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install unalias
pnpm add unalias
yarn add unalias
bun add unalias
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2023-06-07 |
| First published | 2022-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ragnar Paide |
| Maintainers | ragnarpa |
| Keywords | alias, unalias, resolve |

## Links

- npm: https://www.npmjs.com/package/unalias
- Repository: https://github.com/ragnarpa/unalias
- Homepage: https://github.com/ragnarpa/unalias#readme
- Issues: https://github.com/ragnarpa/unalias/issues
- npm.io page: https://npm.io/package/unalias

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.2.4 (latest) — 2023-06-07
- 0.2.3 — 2023-06-06
- 0.2.2 — 2023-01-29
- 0.2.1 — 2023-01-21
- 0.2.0 — 2023-01-21
- 0.1.3 — 2022-10-22
- 0.1.2 — 2022-10-07
- 0.1.1 — 2022-09-18
- 0.1.0 — 2022-09-18

## README

# Unalias

## Installation

```
npm install unalias
```

## Usage

```typescript
import { Resolver, Aliases } from 'unalias';

const aliases: Aliases = {
    Al: ["Alyson", "Alyssa", "Alfred", "Albert", "Alphonse"],
    Sam: ["Sam", "Samuel", "Samson", "Samantha"],
    All: ["Al", "Sam"],
    NoSam: ["All", "-Sam"],
};

const resolver = new Resolver(aliases);

resolver.resolveOne('All');
// [
//   'Alyson',   'Alyssa',
//   'Alfred',   'Albert',
//   'Alphonse', 'Samuel',
//   'Samson',   'Samantha'
// ]

// Subtract Als from All.
resolver.resolveAll(['All', '-Al']);
// [ 'Samuel', 'Samson', 'Samantha' ]

resolver.resolveOne('NoSam');
// [
//   "Alyson",
//   "Alyssa",
//   "Alfred",
//   "Albert",
//   "Alphonse",
// ]
```

## Use Cases

- Group values and combine the groups with creating new aliases
- Give static (nick)names to values that can possibly change

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