Hi

Just use any template engine like ejs <https://www.npmjs.com/package/ejs>



вторник, 27 февраля 2018 г., 17:11:07 UTC+1 пользователь vijay kumar 
написал:
>
> Hi ,
>
>  I want to auto generate models in node.js based on the API spec file 
> .Like model should contain setter method which we can use while passing the 
> data to API .
>
> Example of what i am looking at.How can i generate something like this as 
> shown below.Any help is appreciated.
>
> data: {
>     "name": "String",
>     "description": "String",
>     "externalId": "String",
>     "type": "String", 
>     "members": "String"
> }
>
>
> i want model to be generated with method like 
>
>
> setName(name) {
>     data.name = name;
> }
>
> setDescription(description) {
>   data.description = description;
> }
>
> setExternalId(externalId) {
>    data.externalId = externalId;
> }
>
> setType(type) {
>     data.type = type;
> }
>
>
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/f800c73d-726f-42ab-be29-e6a0a1257dae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to