# teleport-javascript

> A super light and fast JavaScript object (de)serialization that includes date, bigint, regex, etc.

Latest version **1.0.0** (published 2019-11-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install teleport-javascript
pnpm add teleport-javascript
yarn add teleport-javascript
bun add teleport-javascript
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-11-13 |
| First published | 2019-11-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 38.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Udit Vasu |
| Maintainers | codenirvana |
| Keywords | JSON, circular, cyclic, stringify, parse, serialization, date, bigint |

## Links

- npm: https://www.npmjs.com/package/teleport-javascript
- Repository: https://github.com/codenirvana/teleport-javascript
- Homepage: https://github.com/codenirvana/teleport-javascript#readme
- Issues: https://github.com/codenirvana/teleport-javascript/issues
- npm.io page: https://npm.io/package/teleport-javascript

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-11-13
- 0.2.0 — 2019-11-12
- 0.1.0 — 2019-11-06

## README

# teleport-javascript

[![Coverage Status](https://coveralls.io/repos/github/codenirvana/teleport-javascript/badge.svg?branch=master)](https://coveralls.io/github/codenirvana/teleport-javascript?branch=master) [![Build Status](https://travis-ci.org/codenirvana/teleport-javascript.svg?branch=master)](https://travis-ci.org/codenirvana/teleport-javascript) [![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)


A super light and fast JavaScript object (de)serialization that includes Date, BigInt, RegExp, etc.

### Installation
```console
$ npm -i teleport-javascript
```

### Usage
```js
const {parse, stringify} = require('teleport-javascript');

const obj = {
  key: 'value',
  undefined: undefined,
  regex: /a-z/gi,
  set: new Set([-Infinity, NaN, Infinity]),
  bigint: 900719925474099123n,
  symbol: Symbol('key')
};
obj.circular = obj;

const stringified = stringify(obj);
// '[{"key":"1","undefined":"_0","regex":"_1","set":"_2","bigint":"_3","symbol":"_4","circular":"0"},"value",["u","R/a-z/gi","S[[\\"_0\\",\\"_1\\",\\"_2\\"],[\\"n-Infinity\\",\\"nNaN\\",\\"nInfinity\\"]]","b900719925474099123","skey"]]'

const parsed = parse(stringified);
// {
//   key: 'value',
//   undefined: undefined,
//   regex: /a-z/gi,
//   set: Set { -Infinity, NaN, Infinity },
//   bigint: 900719925474099123n,
//   symbol: Symbol(key),
//   circular: [Circular]
// }
```

### Supported Data Types
* String
* Number _(including NaN, Infinity, -Infinity)_
* BigInt
* Boolean
* Symbol
* Null
* Undefined
* Array
  - Int8Array
  - Uint8Array
  - Uint8ClampedArray
  - Int16Array
  - Uint16Array
  - Int32Array
  - Uint32Array
  - Float32Array
  - Float64Array
* Object _(including circular reference)_
  - Date
  - Buffer
  - RegExp
  - Map
  - Set

### Benchmarks
[Benchmark Results](test/bench.txt)

## License
ISC

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