revivejs
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

ReviveJS

Version CI Downloads/week License

ReviveJS is a Javascript json deserializer library for reviving objects along with their prototype/behavior.

Think about all the times you had to call an API, retrieve and parse the JSON response and then map that structure to your own models or build behavior around those structures. ReviveJS simplifies this entire process by reviving entire chains of models in one shot.

import { revive } from 'revivejs'

class Person {
    name = ''
    public sayHi() {
        console.log(`Hi, I'm ${this.name}.`)
    }
}

const data = '{"name": "John Smith"}'
const person = revive(data, Person)
person.sayHi() // Hi, I'm John Smith.

Install

ReviveJS can be installed using npm

$ npm install revivejs

or yarn

$ yarn add revivejs

Documentation

Please check out the full Documentation for more details.

Package Sidebar

Install

npm i revivejs

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

11.6 kB

Total Files

9

Last publish

Collaborators

  • mflorin