Jason
JSON to ES6 class object converter middleware for express
Prerequisites
Jason uses the ES6 Reflect api, which requires at least Node.js version 6.4.0
Installing
npm install jason-parse
Demonstration
So first we define a basic model which requries an empty constructor that takes in parameter ...args
{} { return thisname; } { thisname = newName; }moduleexports = User;
When you POST json to the express server, send it to the parameter entity
so that the middleware can parse it
Now for our express routes that we want to use this middleware on:
const routes = ;const User = ;const jason = ; routes; routes;
Authors
- Tom Orth (atf1999)
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgements
- Spring REST for doing this in their Java web framework and inspiring me to do this for Node.js