简介:
Node.js是一个Javascript运行环境(runtime),发布于2009年5月,由Ryan Dahl开发,实质是对Chrome V8引擎进行了封装。Node.js对一些特殊用例进行优化,提供替代的API,使得V8在非浏览器环境下运行得更好。
V8引擎执行Javascript的速度很是快,性能很是好。Node.js是一个基于Chrome JavaScript运行时创建的平台, 用于方便地搭建响应速度快、易于扩展的网络应用。Node.js 使用
事件驱动, 非阻塞
I/O 模型而得以轻量和高效,很是适合在分布式设备上运行数据密集型的实时应用。
nodejs的特色:
nodejs做为一个新兴的前端框架,,后台语言,有不少吸引人的地方
一、单线程:使用事件轮询的方式来处理并发操做;
二、异步、事件驱动
三、异步消耗内存多,网上有一个一百万级的并发测试,在未优化的状况下1M链接,消耗了16G内存;
nodejs安装:
访问 http://nodejs.cn/download/下载相应的版本,点击下一步,就能完成安装了。
测试是否安装成功:在cmd下输入npm:
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, doctor, edit,
explore, get, help, help-search, i, init, install,
install-test, it, link, list, ln, login, logout, ls,
outdated, owner, pack, ping, prefix, prune, publish, rb,
rebuild, repo, restart, root, run, run-script, s, se,
search, set, shrinkwrap, star, stars, start, stop, t, team,
test, tst, un, uninstall, unpublish, unstar, up, update, v,
version, view, whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\月光\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@5.3.0 F:\Nodejs\node_modules\npm
再输入node -v出现你的node版本号,说明你安装成功了!接下来就能够编写一个Hello world 了。