2

Can anyone guide me for how to create separate libraries for models (Reusable Libraries)?

For example,

If I want to create web, desktop and mobile app, so I required models and services files in all projects to communicate with my API.

I required to models in all projects (Server, Web, Mobile and Desktop App) and Services which can communicate with node.js API (web, Mobile and Desktop App). I don'n want to create files in all project, instead of this I want to create one shareable libraries for models and functions.

Can you guide me how to achieve this type of project structure OR best suitable architecture.

I am a Microsoft Stack developer. So, I can follow this structure in .net but how can I achieve this using node.js or TypeScript?

2
  • I think creating an npm pkg would be suitable for your use case May 14, 2020 at 8:09
  • Can you please explain more about it?
    – Pooja
    May 14, 2020 at 8:43

1 Answer 1

0

You can develop a node module which will be reusable by any project using node run-time. For a basic understanding, go through a medium article

How to Easily Share Reusable Modules in Node.js - at Scale

Note: I'm not an author/promoter of this medium article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.