如果是要退出node命令的话,可以使用:
$ node
> 9+23
32
> process.exit()
$
或者
$ node
> 9+23
32
> .exit
$
如果是要退出node server的话,可以使用:
别人是推荐点击两下 Ctrl-C, 但是我使用的时候不好使,不知道是不是因为需要大写的C才行,所以我使用 Ctrl-Shift-C 的时候就可以了,不过这个快捷键需要结合下面的代码使用:
// this function is called when you want the server to die gracefully
// i.e. wait for existing connections
var graceful… Read More
Example directory
The examples below look at a directory with the following, the same example directory as used in the read through directory post:
bar.txt A regular file
baz A directory
foo.txt A regular file
link2foo.txt A
php.js
php.js is an open source project that brings high-level PHP functions to low-level JavaScript platforms such as web browsers, browser extensions ( Mozilla/Firefox, Chrome ), AIR, and SSJS engines like V8 ( Node.js, v8cgi ), Rhino, and SpiderMonkey ( CouchDB )
If you want to perform high-level operations on these platforms, you probably need to wri…
Example table
The example table used in this post was created with the following SQL:
CREATE TABLE `products` (
`product_id` int(10) unsigned NOT NULL auto_increment,
`url` varchar(100) NOT NULL,
`name` varchar(50) NOT NULL,
`description` varchar(255) NOT NULL,
`price` decimal(10,2) NOT NULL,
`visible` tinyint(1) unsigned NOT NULL default '1',
PR… Read More
代码
var http = require('http');
var requestListener = function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello You\n');
}
var server = http.createServer(requestListener);
server.listen(8080);
If any application is already running on 8080 then you will get the below error (Error: listen EAD… Read More