欢迎来到天天文库
浏览记录
ID:32047872
大小:5.59 MB
页数:282页
时间:2019-01-31
《[Learning.Node(Early.Release,2012.6)].Shelley.Powers.文字版》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、PrefaceNotYourOrdinaryJavaScriptYoupickedtheperfecttimetolearnNode.ThetechnologyevolvingaroundNodeisstillyoungandvibrant,withinterestingnewvariationsandtwistspoppinguponaregularbasis.Atthesametime,thetechnologyhasreachedalevelofmaturitythatassuresyouyourti
2、melearningNodewillbewellspent:installationhasneverbeeneasier,evenonWindows;the"bestofbreed"modulesarebeginningtosurfacefromtheseeminghundredsavailableforuse;theinfrastructureisbecomingrobustenoughforproductionuse.Twoimportantthingstokeepinmindwhenyouworkwi
3、thNode.ThefirstisthatitisbasedinJavaScript,moreorlessthesameJavaScriptyou'reusedtoworkingwithinclient-sidedevelopment.True,youcanuseanotherlanguagevariation,suchasCoffeeScript,butJavaScriptisthelinguafrancaofthetechnology.Thesecondimportantthingtorememberi
4、sthatNodeisn'tyourordinaryJavaScript.Thisisserver-sidetechnology,whichmeanssomeofthefunctionality—andsafeguards—you'vecometoexpectinyourbrowserenvironmentjustwon'tbethere,andallsortsofnewandpotentiallyveryunfamiliarcapabilities,will.wnloadfromWow!eBook5、.wowebook.com>oOfcourse,ifNodewaslikeJavaScriptinthebrowser,whatfunwouldthatbe?DWhyNode?IfyouexplorethesourcecodeforNode,you'llfindthesourcecodeforGoogle'sV8,theJavaScript(technically,ECMAScript)enginethat'salsoatthecoreofGoogle'sChromebrowser.Oneadvantage6、toNode.js,then,isthatyoucandevelopNodeapplicationsforjustoneimplementationofJavaScript—nothalfadozendifferentbrowsersandbrowserversions.Yes,nomoreworryingabouthavingtocodeJavaScriptforIE6.Well,atleastnotforNode.Nodeisdesignedtobeusedforapplicationsthatareh7、eavyoninput/output,butlightoncomputation.Moreimportantly,itprovidesthisfunctionalitydirectlyoutofthebox.Youdon'thavetoworryaboutblockingwhilewaitingforafiletofinishloading,oradatabasetofinishupdating,becausemostofthefunctionalityisasynchronousbydefault.And8、youdon'thavetoworryaboutworkingwiththreads,becauseNodeisimplementedonasinglethread.Mostimportantly,Nodeiswritteninalanguagethatmanytraditionalwebdevelopersarefamiliarwith:JavaScript.Youmaybelearninghowtousene
5、.wowebook.com>oOfcourse,ifNodewaslikeJavaScriptinthebrowser,whatfunwouldthatbe?DWhyNode?IfyouexplorethesourcecodeforNode,you'llfindthesourcecodeforGoogle'sV8,theJavaScript(technically,ECMAScript)enginethat'salsoatthecoreofGoogle'sChromebrowser.Oneadvantage
6、toNode.js,then,isthatyoucandevelopNodeapplicationsforjustoneimplementationofJavaScript—nothalfadozendifferentbrowsersandbrowserversions.Yes,nomoreworryingabouthavingtocodeJavaScriptforIE6.Well,atleastnotforNode.Nodeisdesignedtobeusedforapplicationsthatareh
7、eavyoninput/output,butlightoncomputation.Moreimportantly,itprovidesthisfunctionalitydirectlyoutofthebox.Youdon'thavetoworryaboutblockingwhilewaitingforafiletofinishloading,oradatabasetofinishupdating,becausemostofthefunctionalityisasynchronousbydefault.And
8、youdon'thavetoworryaboutworkingwiththreads,becauseNodeisimplementedonasinglethread.Mostimportantly,Nodeiswritteninalanguagethatmanytraditionalwebdevelopersarefamiliarwith:JavaScript.Youmaybelearninghowtousene
此文档下载收益归作者所有