In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to use NTVS". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Just when you don't think Redmond can get any crazier, today they introduced a VS plug-in tool, Visual Studio's node.js tool.
NTVS (Node.js Tools for Visual Studio) runs on VS2012
Just when you don't think Redmond can get any crazier, today they introduced a VS plug-in tool, Visual Studio's node.js tool.
NTVS (Node.js Tools for Visual Studio) runs on VS2012 or VS2013. Some node.js enthusiasts have moved from PTVS (Python Tools for Visual Studio) to making node tools for VS. At the same time, the PTVS team is also working on node.js integration, so they all focus on NTVS to make it a community project. NTVS was developed by the same team that brought you PTVS, and with the help of Bart Read from Red Gate (he developed the Node Packaged Modules graphical user interface) and Dmitry Tretyakov from Clickberry, they did some debugging and functional fixes.
NTVS has been open source from the beginning and has adopted contributions from the beginning. It supports editing, IntelliSense, analytics, npm (node module encapsulation), local and remote debugging (when the server is running on Windows/MacOS/Linux), and publishing to Azure websites and cloud services.
How they do this is quite amazing, so I suggest you download it and try it, because some of it (even if the original version is given here) is very smart.
NTVS combines the V8 analytics application with Visual Studio's reporting features to tell you where your program consumes its time.
Hint: see the dialog above File | New Project? Visual Studio organizes types according to the development language, so node.js is classified under JavaScript. But you also notice categories such as iOS and Android,TypeScript,VB,F# under the Python,Django,C# category in Visual Studio.
One of the things that impressed me was that when they integrated node.js into Visual Studio, they didn't create or redo features that had been perfected in Visual Studio. This is node, running on node.exe, using the V8 debugger, using the V8 parser because that's what people are using. However, for example, NTVS can take the output from the V8 parser and display the results using the Visual Stuido analysis report tool. There is no need to start all over again, just use the right tools to get the job done.
Use NTVS to complete the Ghost blog engine
Let's look at an example.
Download and install node from http://nodejs.org.
Next, download the Ghost from https://ghost.org/download/ and unzip it somewhere.
Download and install NTVS from install node for Visual Studio in the Visual Studio root directory.
L is optional. Install http://vswebessentials.com because it makes web development in VS easier to show.
Starting with Visual Studio, the order is File | New Project, click JavaScript, and then select "From Existing Node.js code".
Point NTVS to your Ghost directory.
Then set the node.js start file to index.js, click Next, save the project file and finish.
At this point, you have set up Ghost in VS.
Note: since I got the elements of the web page, I also got a good benefit-screen Markdown editor.
From here, click F5 to debug, or Ctrl-F5 to start directly. Of course, notice the node path, port and start file displayed in the project properties window in the lower right corner. Of course you can modify them.
Here I run Ghost locally. You can see the path to node, the ghost.js file and my browser.
You will get tips for implementation and help from the method signature.
Debug
NTVS includes complete debugging support for node applications. This includes step-by-step debugging, breakpoint debugging, "exception interrupts", as well as local variable windows, observation windows, instant windows, and call stack tool windows.
You can handle exceptions like services in other languages. Look at the dialog box below. Node.js exceptions and other exceptions are listed in the category of handled and unhandled code.
With the node V8 debugger, debugging always works as it usually does. Unless Visual Studio connects to the debugger through another socket (remember, you can even run debug node.js remotely on Linux or Mac systems like this) and escape how V8 debugs to how Visual Studio debugs. This feeling is seamless.
From this screenshot, you can see that node.exe has been debugged and I ran Ghost. You can see my call stack and local variables in the observation window. I can look at variables, debug step by step, and do whatever you want when you debug a web application.
NPMVISUAL STUDIO
The experience of using npm is also pretty cool. NTVS always monitors the file system, so running npm as a command line or node direct window is a more popular way, and you'll see changes in Visual Studio.
You can also use the npm package management dialog box and search the library to install the package graphically. It's up to you.
This is a package in installation.
The physical node modules and the operation of these modules are purely coded. VS does not involve or care about it. However, physical views are also rendered as logical views in solution Explorer (Solution Explorer) of Visual Studio.
Hint: I like this very much. I think it has potential, and I prefer .NET references to be handled in the same way. The physical and logical dependency tree shows the NuGet package. This helps me understand the project better.
There's more. There is an interactive REPL window where you can publish web projects using the same release wizard as other web projects using the same release wizard as ASP.NET projects. You can also publish node.js applications directly to Azure, using Git or Visual Studio.
You can also debug node instances remotely on other machines and start node by introducing a remote debugging agent.
That's all for "how to use NTVS". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.