# node-serialize

> Serialize a object including it's function into a JSON.

Latest version **0.0.4** (published 2014-05-26) · 0 weekly downloads

## Install

```sh
npm install node-serialize
pnpm add node-serialize
yarn add node-serialize
bun add node-serialize
```

## Health

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2014-05-26 |
| First published | 2013-06-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 1 |
| Install scripts | no |
| GitHub stars | 77 |
| Author | Zihua Li |
| Maintainers | luin |
| Keywords | serialize |

## Links

- npm: https://www.npmjs.com/package/node-serialize
- Repository: https://github.com/luin/serialize
- Issues: https://github.com/luin/serialize/issues
- npm.io page: https://npm.io/package/node-serialize

## Recent versions

- 0.0.4 (latest) — 2014-05-26
- 0.0.3 — 2013-06-28
- 0.0.2 — 2013-06-28
- 0.0.1 — 2013-06-28

## README

# node-serialize

Serialize a object including it's function into a JSON.

[![Build Status](https://travis-ci.org/luin/serialize.png?branch=master)](https://travis-ci.org/luin/serialize)

## Install

    npm install node-serialize

## Usage

    var serialize = require('node-serialize');

Serialize an object including it's function:


    var obj = {
      name: 'Bob',
      say: function() {
        return 'hi ' + this.name;
      }
    };

    var objS = serialize.serialize(obj);
    typeof objS === 'string';
    serialize.unserialize(objS).say() === 'hi Bob';

Serialize an object with a sub object:

    var objWithSubObj = {
      obj: {
        name: 'Jeff',
        say: function() {
          return 'hi ' + this.name;
        }
      }
    };

    var objWithSubObjS = serialize.serialize(objWithSubObj);
    typeof objWithSubObjS === 'string';
    serialize.unserialize(objWithSubObjS).say() === 'hi Jeff';

Serialize a circular object:

    var objCircular = {};
    objCircular.self = objCircular;

    var objCircularS = serialize.serialize(objCircular);
    typeof objCircularS === 'string';
    typeof serialize.unserialize(objCircularS).self.self.self.self === 'object';

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