@grainrigi/date-reviver
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

date-reviver

Date parser for JSON.parse. Converts any string value in JSON which is compliant with the format of Date.toISOString() into Date object.

Example

import dateReviver from '@grainrigi/date-reviver';

const json = '{ "date": "2020-05-30T00:27:14.068Z" }';

const obj = JSON.parse(json, dateReviver);

// obj.date.valueOf() === 1590798434068

Readme

Keywords

none

Package Sidebar

Install

npm i @grainrigi/date-reviver

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

4.76 kB

Total Files

11

Last publish

Collaborators

  • grainrigi