# revtype

> Turn any JavaScript data structure into its typed representation.

Latest version **0.5.1** (published 2017-09-12) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2017-09-12 |
| First published | 2017-08-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Colton Colcleasure |
| Maintainers | colshacol |
| Keywords | flow, typescript, type-checking, type-safety, safety-dance |

## Links

- npm: https://www.npmjs.com/package/revtype
- npm.io page: https://npm.io/package/revtype

## Dependencies (1)

- [babel-register](https://npm.io/package/babel-register.md) ^6.24.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.5.1 (latest) — 2017-09-12
- 0.5.0 — 2017-08-06
- 0.0.11 — 2017-08-05
- 0.0.1 — 2017-08-03

## README

# revType

> Convert Javascript data structures into their typed counterparts.

### Input:

```javascript
import revtype from 'revtype';

const object = {
  stuff: {},
  things: [],
  nil: null,
	name: 'tommy',
	male: false,
	age: 29,
	mom: {
		name: 'mommy',
		male: false,
		age: 28,
		jobs: [
			'cooking',
			'cleaning',
			'beasting',
			{
				title: 'boss',
				location: 'home',
				salary: 0
			}
		]
	}
};

const revved = revtype.parse(object);
console.log(JSON.stringify(revved));
```

### Output:

```json
{
	"stuff": {},
	"things": [],
	"nil": "null",
	"name": "string",
	"male": "boolean",
	"age": "number",
	"mom": {
		"name": "string",
		"male": "boolean",
		"age": "number",
		"jobs": [
			"string",
			"string",
			"string",
			{
        "title": "string",
        "location": "string",
        "salary": "number"
      }
		]
	}
}

```

### Todo:
- Support for Map
- Support for WeakMap
- Support for Set
- Support for homeless people.

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