This article mainly introduces my personal use of some node. JS development tools, development packages, frameworks and other summaries, the need for friends can refer to the followingSource: Source RepositoryDevelopment tools1.WebStorm, there is no doubt that he belongs to, cross-platform, strong code hints, support Nodejs debugging, but also support VI editing mode, which I like.2. Do small projects with
In the previous section, we talked about the Library management system login, I believe that we have a jade template and angular JS also have a understanding, today we look at a book information input. Here we are going to use the NoSQL database, which is used by MongoDB in this blog post. Ok. Mongo DB Installation I don't have to say much, then the node. JS Plat
, data) {if (err) {Console.log (Err.stack);Return}Console.log (Data.tostring ());});Console.log ("program execution Complete");The above program Fs.readfile () is an asynchronous function used to read the file. If an error occurs during the reading of the file, the error Err object will output an error message.If no error occurs, ReadFile skips the output of the Err object, and the contents of the file are output through the callback function.Execute the above code and execute the result as foll
signal events. I have learned system programming and do not understand this. CTRL + C will trigger Sigint.
Http://en.wikipedia.org/wiki/C_signal_handlingSee this. It seems that we are talking about the same thing.
Process. stdout, stderr
I don't understand the block.
Process. stdin
Stdin is paused by default, so you need to call process. stdin. Resume () to enable the input.
You can listen to data and end events in stdin. data indicates that when a new input is receive
Recently, I have been studying nodejs. nodejs is a parallel and event-based javascript development environment. This is easy to say, but it has made me suffer a lot during development. The following describes how to build the node. js development environment.
I developed it in windows, so I set up the node. js develop
(3000); 6, in the cmd input "" Run in the browser input http://localhost:3000/, enter the display run successfully!. 7. Next we try to connect to the database using node. js, first start the MongoDB service (note: another cmd window): Mongod--dbpath D:\ProgramFiles\mongodb-v3.4\data\db: 8. Modify the code of the Test.js file: var express = Require ("Express");
var App = Express ();
var Mongoclien
out. You may use it after you delete it and comment it out. Use the Debug module for this time. For the time being no node-inspector, no evaluation.4. Keep your code streamlinedTry to use less code to accomplish more things, but also for their ability to upgrade and test. Including correct indentation, proper variable name, clear code organization structure, etc... The code is streamlined, pretty, and when
to read. If at the beginning of the design to consider, this will make later maintenance work relatively convenient, find HTML code directly find HTML file, find JavaScript code directly find JS file, find CSS code directly find CSS file.Separating JavaScript from HTML is one of the things that the front end must do. JavaScript is born to make HTML richer, not more cluttered. Mixing together causes: the bug tracking tool is difficult to
node. JS template Citation Ejs.Search for a recommended with Ejs most.Speed ratio: http://www.cnblogs.com/fengmk2/archive/2011/04/28/2031971.htmlEjs speed is not the fastest, the recommendation is probably because of its simple grammatical structure. The code is nested primarily through There are other custom methods: such as link_to (name, URL), Img_tag (URL), and so on.JSON can also be supported.=========
2.1 Installing ExpressIf a package is a dependency of a project, then we need to install the package in local mode in the project directory, and if you want to invoke the command in this package from the command line, you need to install it in global mode. Express provides a tool for quickly building projects on the command line, so we use global installation:$ NPM Install-g Express 2.2 Establishment of the projectExpress when initializing a project, you need to specify a template engine that e
After troubleshooting, this error is raised because there is a field name of "NodeName" in the table and should be caused by a conflict when the foreground XML parsing occurs. My workaround is to modify the column names and modify the mappings.As follows:[Column ("NodeName")]public string Name {get; set;}PS: Next to my idea, the foreground error place on the breakpoint, loop out (or F8), pay attention to observe the error when the
Development tools1.WebStorm, there is no doubt that he belongs to, cross-platform, strong code hints, support Nodejs debugging, but also support VI editing mode, which I like.2. Do small projects with sublime Text.3.Browserify: Apply your Nodejs module to the browser4.nvm:nodejs Version Management tool, you may use more than one Nodejs version (such as v0.11.x support generator Nodejs and stable version of v0.10.x), with which you can easily switchTesting Automation1.mocha: A simple, flexible a
node. JS has built-in cluster functionality under the v0.6.0 version, as a cluster module for multi-core processing of nodejs, and easier scripting for a load-balanced cluster.The script references the other person's material, builds a server.js (because the virtual machine has only 1 cores, for the simulation multi-threading, so the use of numcpus+4)
var cluster = require(‘cluster‘);var htt
: false)Datestrings: Forces the Timestamp,datetime,data type to be returned as a string type instead of a JavaScript date type (default: false)Debug: Turn on Debug (default: false)Multiplestatements: Whether to make a query with multiple MySQL statements (default: false)Flags: Used to modify connection flags, more details: https://github.com/felixge/node-mysql#co
library is that it eliminates the need to include additional extension libraries, saving development time and improving robustness.
Powerful Developer Workflow Tools
The workspace interface of Go can help establish a standardized workflow, although this may compress the freedom of development, but the resulting is a structured and organized workspace: The area has three root directories,src is used to place the source package, Pkg is used to place the compilation package, the bin is placed in t
1: Download node. js and install it, install it from NPM, choose to install it together.2:node-v display version, npm-v display version.3: I am here to agent to the Internet, first set up NPM agent, if the Internet does not need a proxy, you can skip this step.
NPM Config set proxy http://proxy3.bj.petrochina:8080NPM Config set Https-proxy http://proxy3.bj.
string is appended with Val in the back; 19, map: ' prop ', returns an array of values in the object array that are prop, 20, reverse, flipping an array or string; 21, get: ' Prop ', gets the value of the property ' prop '; 22, JSON, converted to JSON format string
Auxiliary functions use//注意闭合标签 input type="button" value=p|first%>>
Add a method to a template
app.locals[' say ' = function () {return ' Hello ';}; The methods defined in App.locals can be referenced i
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.