简体   繁体   中英

Reference code in other projects in Node.js using Visual Studio

I'm new to node.js, I am trying to setup an infrastructure where I would have a project making up a common layer on which other projects would build upon. I am using visual studio 2015. I am used to this IDE.

The structure should look something like this

This is the structure I currently have in visual studio 2010 when using MVC

What you are thinking of is a method in which you reference projects to create a layered infrastructure ?

If thats the situation, you are missing the part where NodeJS is just Javascript, not C# where your porject compiles to DLLs you can reference.

You can make your NodeJS projects communicate via GET/POST requests, or share Javascript files.

Either way remember Javascript doesn't get compiled.

You can get almost this by using Verdaccio, its almost the same you want but the references are done by external way, not inside Visual Studio, Verdaccio is a "lightweight private npm proxy registry", something like your own private npm registry where you can publish and import your own packages. Cant found an extension to automate this but can be done with npm commands.

https://verdaccio.org/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM