Your browser is out-of-date! Update your browser to view this website correctly. Update my browser now Ã
Your browser is out-of-date! Update your browser to view this website correctly. Update my browser now Ã
ã¯ã¼ã¯ã·ã§ããã¼ã¯ãªã¼ãã³ã½ã¼ã¹ã®å¦ç¿ç¨ã¢ã¸ã¥ã¼ã«ã§ãã ãã¹ã¦ã®ã¯ã¼ã¯ã·ã§ããã¼ã¯ã¦ã£ã¶ã¼ãå½¢å¼ã§ã ï¼ã¯ã¼ã¯ã·ã§ããã«åå ããªãã¦ãåå¼·ã§ãã¾ãï¼ï¼ã ã»ã¨ãã©ã¯ãªãã©ã¤ã³ã§ãåãã¾ãã
è³æãæ¼ã£ã¦ãããããããªãã®ã§ããµã³ãã«ã³ã¼ããæ¸ãã $ cat p.js var f = function(resolv, reject){ console.log("hello"); resolv("goodbye"); }; console.log("f"); var p = new Promise(f); console.log("p"); p.then(function(result){ console.log(result); }); console.log("t"); å®è¡çµæãPromise ã new ãããããã«å®è¡ããã¦ãã $ node p.js f hello p t goodbye å®è¡ãããå¾ã§ããthen ã¡ã½ããã§å¾ã®å¦çãæå®ã§ãã¦ããã®ãããããthen ã¡ã½ããã§æå®ããå¦çã¯éåæã«å®è¡ããã¦ããã Promise ã new ããæç¹ã§å®è¡ã
ç°å¢ OS: OS X 10.10.5 åæ Heroku Toolbeltãã¤ã³ã¹ãã¼ã«ããã¦ããã㨠node.jsãã¤ã³ã¹ãã¼ã«ããã¦ããã㨠ãããã¤ã¾ã§ #å ¬å¼ãµã³ãã«ããã¸ã§ã¯ããå©ç¨ $ git clone https://github.com/heroku/node-js-getting-started.git Cloning into 'node-js-getting-started'... remote: Counting objects: 442, done. remote: Total 442 (delta 0), reused 0 (delta 0), pack-reused 442 Receiving objects: 100% (442/442), 224.68 KiB | 119.00 KiB/s, done. Resolving deltas: 100%
Notable changes build: Add support for Intel's VTune JIT profiling when compiled with --enable-vtune-profiling. For more information about VTune, see https://software.intel.com/en-us/node/544211. (Chunyang Dai) #3785. Properly enable V8 snapshots by default. Due to a configuration error, snapshots have been kept off by default when the intention is for the feature to be enabled. (Fedor Indutny) #3
Debian GNU/Linux 㧠Node.js ã使ãããã¨æã£ã¦ãããã©ã Debian jessie ã§ã¯ Node.js ã®ããã±ã¼ã¸ã¯ã»ãã¥ãªãã£ã¢ãããã¼ããåããããªã ã¨ããç¶æ³ã ã¾ãã Node.js ã¯é »ç¹ã«ãã¼ã¸ã§ã³ã¢ãããããã®ã§ããããã Debian ã®ããã±ã¼ã¸ç®¡çã·ã¹ãã ã«é ¼ãã®ãå¾®å¦ã ãã¨ãã£ã¦ãNode.js ã®ã½ã¼ã¹ã³ã¼ãããèªåã§ã¤ã³ã¹ãã¼ã«ãã¦ç®¡çããã®ã大å¤ã ãã㧠nodebrew ã¨ãã Node.js ã®ãã¼ã¸ã§ã³ç®¡çã·ã¹ãã ãã¤ã³ã¹ãã¼ã«ãã¦å©ç¨ããã ä»åã®ç°å¢ã¯ Debian 8 jessie $ cat /etc/debian_version 8.2 $ uname -mrsv Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) x86
Node.js ã®æ¨æºã©ã¤ãã©ãªã¨ãã¦ã File System ã¢ã¸ã¥ã¼ã«ã¨ãã POSIX é¢æ°ã®ã·ã³ãã«ãªã©ããã¼ãæä¾ããã¦ããã®ã§ãããã® readFile é¢æ°ã使ãã®ãã¹ã¿ã³ãã¼ãã â File System Node.js v5.0.0 Manual & Documentation åæå¦çã§ãã readFileSync é¢æ°ã¨ãéåæã® readFile é¢æ°ãç¨æããã¦ããã以ä¸ããµã³ãã«ã³ã¼ãã var file = "./hoge.txt"; var fs = require("fs"); // æåã¨ã³ã³ã¼ãã£ã³ã°ãæå®ãã¦ã // åæçã«ããã¹ããã¡ã¤ã«ãèªã¿è¾¼ãã var contents = fs.readFileSync(file, "utf8"); console.log(contents); // æåã¨ã³ã³ã¼ãã£ã³ã°ãæå®ãã¦ã // éåæã«
Node.jsã§ã¢ããªãä½ã£ãæã«ããã©ã¡ã¼ã¿ãè¨å®ãã¡ã¤ã«ã«æ¸ãåºãã¦éçºç°å¢ãã¹ãã¼ã¸ã³ã°ããããã¯ã·ã§ã³ç°å¢ãªã©ã§åãæ¿ãããã¨ãããã¾ãããã®æã«ä½¿ç¨ã§ããã®ããnode-configã¢ã¸ã¥ã¼ã«ã è¨å®ãã¡ã¤ã«ã¨ãã¦å¯¾å¿ãã¦ãããã©ã¼ããã Javascript Object Notation - .json Javascript5 Object Notation - .json5 Yet another markup language - .yaml Javascript - .js CoffeeScript - .coffee CoffeeScript Object Notation - .cson Properties file format - .properties ãã¡ã¤ã«ã®èªã¿è¾¼ã¿é é常ã¯å®è¡ãã¦ããã¢ããªã®./configãã£ã¬ã¯ããªä¸ã®è¨å®ãã¡ã¤ã«ãèªã¿è¾¼ã¿ã¾ã
Expressã§ãã³ãã¬ã¼ãããããã¸ã§ã¯ããä½ãã¨ãç¾å¨ã®ææ°ç2.5.4ã§ã¯ . âââ app.js âââ package.json âââ public â âââ images â âââ javascripts â âââ stylesheets â âââ style.css âââ routes â âââ index.js âââ views âââ index.jade âââ layout.jade 6 directories, 6 filesã®ããã«ãã¡ã¤ã«ã¨ãã£ã¬ã¯ããªãä½ããããapp.jsãæ¬ä½ã§ã var express = require('express') , routes = require('./routes') var app = module.exports = express.createServer(); ... app.get('/',
Node.js ã®æ¨æºã©ã¤ãã©ãªã¨ãã¦ã File System ã¢ã¸ã¥ã¼ã«ã¨ãã POSIX é¢æ°ã®ã·ã³ãã«ãªã©ããã¼ãæä¾ããã¦ããã®ã§ãããã® readdir é¢æ°ã使ãã®ãã¹ã¿ã³ãã¼ãã â File System Node.js v5.0.0 Manual & Documentation åæå¦çã§ãã readdirSync é¢æ°ã¨ãéåæã® readdir é¢æ°ãç¨æããã¦ããã以ä¸ããµã³ãã«ã³ã¼ãã var path = "."; var fs = require("fs"); // åæçã«ãã£ã¬ã¯ããªå ã«ãããã¡ã¤ã«åã®ä¸è¦§ãé åã§åå¾ // "." 㨠".." ã¯å«ã¾ããªã var files = fs.readdirSync(path); files.forEach(function(file){ console.log(file); }); // éåæã«ãã£ã¬
Node.js ã®ææ°ç v5.0.0 㧠ECMAScript 2015 (ES6) ã® class ã使ã£ã¦ã¿ãã Node.js ã®å ¬å¼ããã¥ã¡ã³ã ECMAScript 2015 (ES6) | Node.js ã«ããã¨ã class æ§æ㯠strict ã¢ã¼ãã§ãªãã¨ä½¿ããªãã¨ã®ãã¨ã ã¾ããES6 ã¢ã¸ã¥ã¼ã«ä»æ§ã® import export ã使ã£ã¦ã¿ããã£ããã© Node.js ã§ã¯ã¾ã ãµãã¼ãããã¦ããªãã£ãã®ã§ä»åã¯ãã¹ (æ®å¿µ)ã ãµã³ãã«ã³ã¼ã Node.js ã§åããããã® JavaScript ã³ã¼ãã ã¡ã¤ã³å¦ç main.js $ cat main.js // Node.js 㯠strict ã¢ã¼ãã§ãªã㨠class ã使ããªã "use strict"; // Node.js ã§ã¯ã¾ã import export æ§æã使ããªãã®ã§ require
OSSéçºã«ãããåæå½¢æã«JavaScriptã§åå ããå¤åãèµ·ãã / front-end-lounge-1
ä»åã®ç°å¢ Mac OS X Yosemite 10.10.5 nodebrew 㧠Node.js v5.0.0 ãã¤ã³ã¹ãã¼ã«ãã äºåã« nodebrew ãã¤ã³ã¹ãã¼ã«ãã¦ãããåè â [ã ] Node.js ã®ãã¼ã¸ã§ã³ã nodebrew ã§ç®¡çãã (with Mac OS X + Homebrew) (2015-03-13) $ nodebrew ls-all | grep 5.0.0 v5.0.0 $ nodebrew install-binary v5.0.0 fetch: http://nodejs.org/dist/v5.0.0/node-v5.0.0-darwin-x64.tar.gz ######################################################################## 100.0% Install s
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}