Node.js Manual & DocumentationContents Synopsis 概要 Global Objects 全局对象 o global o process o require() o require.resolve() o require.paths o __filename o __dirname o module Timers 定时器 o setTimeout(callback . o Loading from the `require.paths` Folders 从`require.paths`目 录中加载 Note:** Please Avoid Modifying `require.paths` **注意:** 请不要修改`requires.paths` Setting `require.paths` to some other value value does nothing. 将`require.paths`设为其他值不会产生任何作用 Putting relative paths in `require.paths` is... weird. 不建议在`require.paths`中发入相对路径 Zero Isolation 零隔离 Addenda: Package Manager Tips 附录:包管理技巧0 码力 | 153 页 | 1.21 MB | 1 年前3
Node.js - the coreargument and is named err Some libraries require following these conventions ex. Async.js See example on next slide 10 Node.js Callback Example 11 var fs = require('fs'); function readObject(filePath (err, obj) { if (err) { console.error(err); } else { console.log(obj); } }); fs = require 'fs' readObject = (filePath, cb) -> fs.readFile filePath, (err, buf) -> if !err try https://github.com/caolan/async 12 Node.js Async Example 13 var async = require('async'); var fs = require('fs'); var rimraf = require('rimraf'); // Unix "rm -rf" for Node var dirPath = 'foo'; var fileName0 码力 | 124 页 | 7.87 MB | 1 年前3
The Node.js Handbook
js application The most common example Hello World of Node.js is a web server: 11 const http = require('http') const hostname = '127.0.0.1' const port = 3000 const server = http.createServer((req way to load modules across all JavaScript, frontend or backend, but Node.js still supports the require syntax. 6. The V8 JavaScript Engine V8 is the name of the JavaScript engine that powers Google is done. Many times with Node.js we start servers, like this HTTP server: 25 const express = require('express') const app = express() app.get('/', (req, res) => { res.send('Hi!') })0 码力 | 161 页 | 1.66 MB | 1 年前3
Back to Basics Testing"gtest/gtest.h" std::string left_pad(std::string const& str, size_t min_len, char pad_char=' '); REQUIRE(left_pad("", 0) == ""); ASSERT_EQ(left_pad("", 0), "");58 TEST_CASE("left_pad pads strings to a left_pad(std::string const& str, size_t min_len, char pad_char=' '); REQUIRE(left_pad("", 0) == ""); ASSERT_EQ(left_pad("", 0), ""); REQUIRE(left_pad("abc", 0) == "abc"); ASSERT_EQ(left_pad("abc", 0), "abc"); left_pad(std::string const& str, size_t min_len, char pad_char=' '); REQUIRE(left_pad("", 0) == ""); ASSERT_EQ(left_pad("", 0), ""); REQUIRE(left_pad("abc", 0) == "abc"); ASSERT_EQ(left_pad("abc", 0), "abc");0 码力 | 79 页 | 25.86 MB | 6 月前3
httpd 2.4.25 中文文档changes in the API updates overview. This document describes changes in server behavior that might require you to change your configuration or how you use the server in order to continue using 2.4 as you significant changes in authorization configuration, and other minor configuration changes, that could require changes to your 2.2 configuration files before using them for 2.4. Authorization Any configuration RequireAll. If you use mod_authz_dbm, you must port your configuration to use Require dbm-group ... in place of Require group .... Access control In 2.2, access control based on client hostname, IP address0 码力 | 2573 页 | 2.12 MB | 1 年前3
httpd 2.4.23 中文文档changes in the API updates overview. This document describes changes in server behavior that might require you to change your configuration or how you use the server in order to continue using 2.4 as you significant changes in authorization configuration, and other minor configuration changes, that could require changes to your 2.2 configuration files before using them for 2.4. Authorization Any configuration RequireAll. If you use mod_authz_dbm, you must port your configuration to use Require dbm-group ... in place of Require group .... Access control In 2.2, access control based on client hostname, IP address0 码力 | 2559 页 | 2.11 MB | 1 年前3
httpd 2.4.20 中文文档changes in the API updates overview. This document describes changes in server behavior that might require you to change your configuration or how you use the server in order to continue using 2.4 as you significant changes in authorization configuration, and other minor configuration changes, that could require changes to your 2.2 configuration files before using them for 2.4. Authorization Any configuration RequireAll. If you use mod_authz_dbm, you must port your configuration to use Require dbm-group ... in place of Require group .... Access control In 2.2, access control based on client hostname, IP address0 码力 | 2533 页 | 2.09 MB | 1 年前3
httpd 2.4.18 中文文档changes in the API updates overview. This document describes changes in server behavior that might require you to change your configuration or how you use the server in order to continue using 2.4 as you significant changes in authorization configuration, and other minor configuration changes, that could require changes to your 2.2 configuration files before using them for 2.4. Authorization Any configuration RequireAll. If you use mod_authz_dbm, you must port your configuration to use Require dbm-group ... in place of Require group .... Access control In 2.2, access control based on client hostname, IP address0 码力 | 2467 页 | 1.89 MB | 1 年前3
httpd 2.4.17 中文文档changes in the API updates overview. This document describes changes in server behavior that might require you to change your configuration or how you use the server in order to continue using 2.4 as you significant changes in authorization configuration, and other minor configuration changes, that could require changes to your 2.2 configuration files before using them for 2.4. Authorization Any configuration RequireAll. If you use mod_authz_dbm, you must port your configuration to use Require dbm-group ... in place of Require group .... Access control In 2.2, access control based on client hostname, IP address0 码力 | 2455 页 | 1.88 MB | 1 年前3
Learning Gulp$ npm install --save-dev gulp 5. Create a gulpfile.js at the root of your project: var gulp = require('gulp'); gulp.task('default', function() { // place code for your default task here }); 6 parameters is an array of tasks to be executed and completed before your task will run: var gulp = require('gulp'); gulp.task('one', function() { // compile sass css }); gulp.task('two', function() Concat js file in sub folder using gulp var gulp = require('gulp'); // include plug-ins var uglify = require('gulp-uglify'), concat = require('gulp-concat'); // Minified file gulp.task('packjsMin'0 码力 | 45 页 | 977.19 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100













