简体   繁体   English

使用Visual Studio的Node.js中其他项目中的参考代码

[英]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. 我是node.js的新手,我试图建立一个基础结构,在该基础结构中,我将有一个项目构成一个公共层,其他项目将基于该层构建。 I am using visual studio 2015. I am used to this IDE. 我正在使用Visual Studio2015。我已经习惯了此IDE。

The structure should look something like this 结构应该看起来像这样

This is the structure I currently have in visual studio 2010 when using MVC 这是我目前在Visual Studio 2010中使用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. 如果是这种情况,那么您会丢失NodeJS只是Javascript而不是C#(您的项目将其编译为可以引用的DLL)的部分。

You can make your NodeJS projects communicate via GET/POST requests, or share Javascript files. 您可以使您的NodeJS项目通过GET / POST请求进行通信,或者共享Javascript文件。

Either way remember Javascript doesn't get compiled. 无论哪种方式,请记住Javascript不会被编译。

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. 您可以通过使用Verdaccio来获得几乎所有功能,它几乎与您想要的相同,但是引用是通过外部方式完成的,而不是在Visual Studio内完成,Verdaccio是“轻量级私有npm代理注册表”,类似于您自己的私有npm注册表,发布和导入自己的包。 Cant found an extension to automate this but can be done with npm commands. Cant找到了一个扩展来自动执行此操作,但是可以使用npm命令来完成。

https://verdaccio.org/ https://verdaccio.org/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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