This article will introduce to you some modules commonly used in Nodejs development. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Collects some modules commonly used in NodeJS development.
nodejs Tutorial"]
is a rich framework for building Node.js-based applications and services, allowing developers to focus on portable and reusable application logic rather than building architecture. It has built-in input validation, caching, authentication and other functions commonly used in web application development. It is also a good choice for developing rest code.
Front-end template -, which has relatively few functions and is relatively low-level. In fact, Mongoose is built on it. Others: redis,
mysqlis similar to log4j in JAVA, with functions such as colored console logging and the ability to set output levels. Simple and easy to use, enough to use if there are no complex requirements. winston is a log module with more powerful and complex functions. It is relatively popular. Those who are pursuing functions can take a look at this module.
can be understood as a simplified CURL module that establishes various HTTP requests and supports authorization Verification, in fact, there are still many functions, which basically meet most needs. Currently among the top NPM modules.
Q is another very good choice, it implements the promises interface.
can be seen as a nodejs daemon. Able to start, stop, and restart our app application, run stably, support high concurrency, simple start/stop commands, support hot deployment, restart after downtime, monitoring interface and logs, and cluster environment. pm2 is a process manager for Node applications with load balancing function. When you want your standalone code to utilize all CPUs on all servers and keep the process alive, 0 second reloads. If you want to solve the NodeJS server management problem from the operating system level, you can refer to:
Linux system service upstartsupervisor during developmentStart the service, which can monitor files and automatically restart the service when there are file updates. In fact, Forever also has this function.
Project Managementis an automated build tool for tasks that need to be repeated over and over again, such as minification, compilation, and units. For testing, linting, etc., automated tools can reduce your labor and simplify your work. When you configure the task correctly, the task runner will automatically complete most of the boring work for you or your team. And it has a large number of plug-ins available. I mainly use it for front-end automated processing.
boweris another open source project of Twitter, developed using nodejs and used for web package management. As a js dependency management tool, it provides an ideal package management method, using some ideas of npm, to provide us with a comfortable development environment.
yeomanwas developed by Google's team in collaboration with a team of external contributors. Its goal is to use Grunt (a command line tool for automating development tasks) and Bower (an HTML, A package manager for front-end resources such as CSS, Javascript, and images) that creates an easy-to-use workflow for developers. The purpose of Yeoman is not only to establish workflows for new projects, but also to solve many serious problems faced by front-end development, such as scattered dependencies.
Scheduled tasks -Later
. It can be used for those with higher functional requirements. The disadvantage of later is that it is a bit complicated. Unlike cron, it only needs to be used. Will use it.underscore is a JS tool library that mainly provides some basic tool functions for arrays, objects, functions, etc., which can be used in the browser at the same time and run in NodeJS environment. Recommended for use in every project.
moment is a date tool library that mainly provides parsing, verification, operation and formatting of dates. If you need to perform more operations or more complex operations on dates, Then it is a good choice, after all, the Date function that comes with JS is too weak.
Connect is a collection of middleware, including log, session, cookie, body parser, etc. It does a lot of basic work related to HTTP, and the Express framework relies on it. carrying out work.
For more programming related knowledge, please visit: Programming Video! !
The above is the detailed content of Summarize some modules commonly used in Nodejs development. For more information, please follow other related articles on the PHP Chinese website!