# nosj

> JSON serializer and deserializer for simple JSON objects.

Latest version **1.0.1** (published 2016-05-18) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-05-18 |
| First published | 2016-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Blain Smith |
| Maintainers | blainsmith |
| Keywords | json, stringify, parse, serialize, deserialize, serializer, deserializer |

## Links

- npm: https://www.npmjs.com/package/nosj
- Repository: https://github.com/blainsmith/nosj
- Homepage: https://github.com/blainsmith/nosj#readme
- Issues: https://github.com/blainsmith/nosj/issues
- npm.io page: https://npm.io/package/nosj

## 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.1 (latest) — 2016-05-18
- 1.0.0 — 2016-03-17

## README

# nosj [![Build Status](https://travis-ci.org/blainsmith/nosj.svg?branch=master)](https://travis-ci.org/blainsmith/nosj)

> JSON serializer and deserializer for simple JSON objects.


## Install

```
$ npm install --save nosj
```


## Usage

```js
var nosj = require('nosj');

var obj = {
	string: 'hello',
	number: 13,
	float: 3.14,
	date: new Date('01/13/1982'),
	array: [
		{a: 'a'},
		{b: 'b'}
	],
	object: {
		x: 'x',
		y: 'y'
	}
};
nosj.serialize(obj);
//=> {"string":"hello","number":13,"float":3.14,"date":"1982-01-13T05:00:00.000Z","array":[{"a":"a"},{"b":"b"}],"object":{"x":"x","y":"y"}}

var string = '{"string":"hello","number":13,"float":3.14,"date":"1982-01-13T05:00:00.000Z","array":[{"a":"a"},{"b":"b"}],"object":{"x":"x","y":"y"}}'
nosj.deserialize(string);
//=>
// {
//   string: 'hello',
//   number: 13,
//   float: 3.14,
//   date: Wed Jan 13 1982 00:00:00 GMT-0500 (EST),
//   array: [ { a: 'a' }, { b: 'b' } ],
//   object: { x: 'x', y: 'y' }
// }
```


## API

### serialize(object)

> Serialize a string back into JSON

### deserialize(string, [options])

> Deserialize a string back into JSON

#### options

##### stringToDates

Type: `boolean`  
Default: `true`

Convert all [ISO 8601](https://www.w3.org/TR/NOTE-datetime) date formatted strings to a `Date`.


## License

MIT © [Blain Smith](http://blainsmith.com)

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