Add NPM package management to existing project

Nov 27, 2013 at 4:56 PM
Hey, great project! I just presented your guy's work @ my company and everyone's really pumped!

I was wondering if there's any way to roll the NPM package management piece into existing projects? I'd love to be able to leverage that.

Nick
Developer
Nov 28, 2013 at 1:19 PM
Hi Nick,


I'm not sure exactly what you mean, but hopefully the following is helpful...

You can certainly use it to manage npm packages in existing node projects: just open up Visual Studio and go to File > New Project, then Other Languages > JavaScript, and then choose to create a new project from existing code.

If you want to reuse the npm code in another .NET application this should also be relatively straightforward. The npm API is all wrapped up in the Microsoft.NodejsTools.Npm assembly, and you'll find the UI in the NpmUI namespace in the Nodejs project, which compiles down to the Microsoft.NodejsTools assembly. Be warned that, in particular, the NpmUI code is very unstable and much of it will change over the next couple of months. The npm API is also undergoing change as well - remember, this is only an alpha. Many of the changes to the latter are extensions to the functionality but, inevitably, there will be some refactoring.

Depending on what you want/need you can pull/fork direct from master, but if you want the latest editions pull from the rgnpm01 fork. Please check the commit log for the latest changes.

If you need anything else, please shout!


Thanks,


Bart
Developer
Nov 28, 2013 at 4:02 PM
Also, here are instructions for building NTVS from source:

https://nodejstools.codeplex.com/wikipage?title=Build%20Instructions%20for%20NTVS
Jun 5 at 4:57 PM
I'd love it if it would be possible to add the GUI npm management tools to an existing project. For example, we'd like to use Gulp as a task runner for front end code, but the project it would be added to is a C# MVC project. We'd love to use the npm GUI tools to accomplish this - right now we have to use something like Ncapsulate.Gulp & Ncapsulate.Node, which works fine, but seems like an unnecessary layer of abstraction.
Coordinator
Jun 5 at 5:28 PM
It's technically possible, but the tricky part is deciding when it should happen. Should it pop up in any project that has a "node_modules" folder at the root level? Or should it be a context menu item for any node_modules at any level?