-- Address: http://blog.chrisyip.im/nodejs-101-package-promise-and-async
First, let's review the Sagase project structure:
lib/ cli.js sagase.jsGruntfile.jspackage.json
I spoke about it in the previous article.package.json, This articlelib/sagase.js.
Because the code is relatively long, we will talk about it separately in one section. For the complete code, open GitHub.
'use strict';
Notifies the compiler to enter strict mode. The main function
the compilation is complete:
Python. For Gyp, you can see if Python is installed by executing the python command under the shell, and confirm that the version meets the requirements (2.6 or later, but not 3.0).
The source code compiler, usually the Unix/linux platform comes with a C + + compiler (gcc/g++). If not, install make,g++ These compilation tools through the current release of the package installation tool.
The tool under the Debian/ubuntu is Apt-get
Redhat
Mac version upload image tool plug-in implementationGiven that blogging manually uploaded to the bed is cumbersome, a long time ago wrote a Windows version of the software plug-in, used to quickly upload pictures to the picture bedRe-packaging users over billions of open source software-adding images automatically uploaded to the function of the image bedNow change the system, from Windows replaced by
Recently, I decided to refresh node. js and use it to merge JS files. Because I forgot about it, let's see if I can output a page first. Below are some of my notes, saving you the trouble to forget the installation process. If it succeeds, you can use the node command. Node.
network application is the processing efficiency of I/O. Due to the limitations of hardware and network, the speed of I/O is often fixed, how to deal with more customer requests in this premise, and improve the efficiency of CPU usage becomes the biggest problem for the developers. Thanks to the event-driven programming model, node. JS uses a single event loop thread to process customer requests, assigning
fully understand, and the Foundatio N necessary to build additional functionality into your app. And we ' ll do it in about minutes of installation and coding. Is that awesome? I submit that it is.
Let ' s go. Part i–15 MINUTES of installing
If you are really starting from scratch, then getting everything the up and running takes a little bit of time. None of it is difficult. I Run Windows 8 on me main machine, so it ' ll be slightly different for those on a
Crawl target: That's my own blog: http://www.cnblogs.com/ghostwu/Features that need to be implemented:Crawl Blog All article title, hyperlinks, article summaries, release timeLibraries that need to be used:node. js comes with the HTTP libraryThird party libraries: Cheerio, this library is used to handle the DOM node, his usage is almost identical to jquery usage, so with this tool, writing a crawler is very
Use node's npm to download Vue's Open source project on GitHub and run it.
Get ready:
1. Install the node. JS Global installation Node-v check for successful installation
2: Install VUE-CLI use VUE-V to check if installation is successful note is uppercase
Begin:
1. Find the GIT address for the
Example of using Meteor with Node. js to compile real-time chat applications
This article mainly introduces how to use Meteor with Node. js Code example of real-time chat application, Node. as an asynchronous framework, js is used
The installation process will not be mentioned. If it succeeds, you can use the node command. Node. js debugging is very convenient. Each background language has a command to output a pragmatic command to the console Group of the Black hacker. Node. js follows the FF set, th
[int4].phone);
}
document.write (d);
}
function String2linklist (Linkmans) {
var linkarray = new Array ();
var a = linkmans.split (' + ');
Alert (a[0]);
for (var int = 0; int var B = a[int].split ('-');
Alert (b[2]);
Linkarray.push (New Linkman (b[0],b[1],b[2));
}
return linkarray;
}
function String2direlist (dires) {
var direlist = new Array ();
var a = dires.split (' + ');
for (var int = 0; int var B = a[int].split ('-');
Alert (b[1]);
Direlist.push (new Dire (b[0],b[1));
If there are no tools and plugins to write JavaScript code to encounter syntax errors it takes time to ask a colleague how to check with node. jsReport a syntax error when testing with a browser.1. Click the blue button in the red circle, and the next refresh will automatically debug the breakpoint when the exception is thrown.3. After the error breakpoint, in the console with var a = code, the code is assigned to a (so printing faster), and then ente
This article describes how to use nodeweibo, a simple encapsulation library for node crawling Weibo data. For more information, see the following introduction.
In July, I had the idea that I would use node to crawl Weibo data, so I simply encapsulated a nodeweibo database. After one year, the function format is changed to the configuration file in the middle of the process. Some other previous projects hav
. JSON in interactive mode
NPM adduser generates users on the node repo website through interaction
NPM publish can publish the package. If necessary, update the version number in package. JSON and re-publish.
NPM unpublish can unpack
3.3 debugging
3.3.1 node debug
Node debug script. js can be debugged under the comman
advance next time. However, the test results are not satisfactory, and this is not elegant enough.
So we have to change our mind. Whether setTimeout () can expire as quickly as possible, and then we check whether the current time has reached the target time. For example, in our Loop, using setTimeout (callback, 1) to continuously check the time seems like a good idea.
Disappointing timerWe immediately wrote a piece of code to test our ideas, and the results were disappointing. Run the following
advance next time. However, the test results are not satisfactory, and this is not elegant enough.
So we have to change our mind. Whether setTimeout () can expire as quickly as possible, and then we check whether the current time has reached the target time. For example, in our loop, using setTimeout (callback, 1) to continuously check the time seems like a good idea.
Disappointing TimerWe immediately wrote a piece of code to test our ideas, and the results were disappointing. Run the following
, and the backend using JavaScript to facilitate front-to-back coordination and communication; node. JS has a powerful open Community, so that the development team can effectively use the power of the community and other three aspects. JPC took advantage of the 103 NPM packages in the community and shared the 7 packages it developed.Despite the very good features
engine executes JavaScript very fast and performs well. Node optimizes some of the special use cases. Provides an alternative API that enables V8 to perform better in a non-browser environment.Do you understand me?Seriously, I didn't read it!So what exactly is node. js?Web back-end development language, do you understand this?ASP, JSP, PHP is what you do not und
. This is what Node retrives//parameters passed in from client requests. The URL module//handles all these functions. The parse function//deconstructs the URL, and places the query key-values in the//query object. We can find the value for the ' number ' key//by referencing it directly-the beauty of JavaScript. var params = Url.parse (Request.url, true). Query; var input = Params.number; These is the generic JavaScript methods that
This article describes how to install the Ghost blog platform on Ubuntu. for more information about how to install Ghost on Ubuntu Server 14.04 LTS (Trusty.
Ghost is a well-designed release platform that is easy to use and free to anyone. It is a free open-source software (FOSS) and its source code is on Github. As of January 2015 (LCTT: the original article is 2014 and should be 2015), its interface is very simple and there is an analysis Panel v. E
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.