# ts-void

Latest version **0.0.1** (published 2022-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-void
pnpm add ts-void
yarn add ts-void
bun add ts-void
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-08-11 |
| First published | 2022-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Paolo Longo |
| Maintainers | paol-imi-org |
| Keywords | typescript, void, ts, null, types |

## Links

- npm: https://www.npmjs.com/package/ts-void
- Repository: https://github.com/paol-imi/ts-void
- Homepage: https://github.com/paol-imi/ts-void#readme
- Issues: https://github.com/paol-imi/ts-void/issues
- npm.io page: https://npm.io/package/ts-void

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2022-08-11
- 0.0.0 — 2022-08-07

## README

<div align="center">
  
<img src="./void.png" width="25%" /><br>

<h1><b>TS-VOID</b><sup><small>&#632;</small></sup></h1>

<em>“The eternal void is filled with infinite possibilities”</em> ~ Laozi

[![Typescript](https://img.shields.io/badge/typescript-000?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org)
[![Void](https://img.shields.io/badge/void-000?style=for-the-badge&logo=ghost&logoColor=white)](/)
[![npm](https://img.shields.io/npm/v/ts-void?style=for-the-badge&color=000&labelColor=000)](http://npm.im/ts-void)

</div>

## Void 🔮

How do you check if this variable contains a value?

```ts
let value: Value;
```

You may initialize it with `undefined` or `null`, but what if `Value` is a generic you don't control, and it can be one of these values?

```ts
import { Void } from "ts-void";
```

You may use `Void` as a new primitive value.

```ts
let value: Value | Void;
```

then you can check if the variable is `Void`.

```ts
if (value !== Void) {
  // Now the value is only of type "Value".
}
```

You may also use the utility type.

```ts
import { type NonVoid } from "ts-void";
```

And extract the original type from the union.

```ts
type Extracted = NonVoid<T | Void>; // equals to T.
```

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