# serializer

> JSON serializer and parser with secure.

Latest version **0.0.3** (published 2011-06-14) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2011-06-14 |
| First published | 2011-02-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |

## Links

- npm: https://www.npmjs.com/package/serializer
- Repository: https://github.com/AF83/node-serializer
- npm.io page: https://npm.io/package/serializer

## Recent versions

- 0.0.3 (latest) — 2011-06-14
- 0.0.2 — 2011-02-21
- 0.0.1 — 2011-02-18

## README

# Serializer

This module provides function to go from JSON obj to [opaque] string or vice & versa.

 - stringify(obj): Returns dump of the given JSON obj as a str. There is no encryption, and it might not be safe. Might throw an error.
 - parse(str): Returns obj loaded from given string (result of dump_str function). Might throw an error.
 - [signStr(str, key): Returns base64url signed sha1 hash of str using key.]
 - secureStringify(obj, encrypt_key, validate_key): Return str representing the given obj. It is signed and encrypted using the given keys.
 - secureParse(str, encrypt_key, validate_key): Given a string resulting from dump_secure_str, load corresponding JSON.
 - createSecureSerializer(encrypt_key, validate_key): Return class to store encryption/validation keys in a more convenient way. The object created will have the methods parse(obj) and stringify(str) corresponding to secureParse and secureStringify.

The cypher used is aes256, the crypted data are in hex. The signing process uses HMAC with SHA1.

## Tests

    $> npm install vows
    $> vows test_serializer.js  --spec

## Credits

Extracted from [nodetk](https://github.com/AF83/nodetk).

Original author: Pierre Ruyssen

## License

BSD

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