Dab tsi yog qhov tshwm sim tau tsav hauv NodeJS?
Dab tsi yog qhov tshwm sim tau tsav hauv NodeJS?

Video: Dab tsi yog qhov tshwm sim tau tsav hauv NodeJS?

Video: Dab tsi yog qhov tshwm sim tau tsav hauv NodeJS?
Video: Nkauj tawm tshiab _QHov twg los tau _ by Xim vaj & Xeeb vwj & xis nus vaj _ (2020 - 2021 ) 2024, Kaum ib hlis
Anonim

Los ntawm txhais, NodeJS yog ib xwm txheej - tsav nonblocking runtime ib puag ncig rau JavaScript uas tau ua nrov heev ntawm server sab. Qhov no yog vim Nodejs muaj ib xwm txheej - tsav architecture muaj peev xwm ntawm asynchronous I / O.

Ua kom pom qhov no, dab tsi yog qhov kev tshwm sim uas tau tsav los ntawm kev ua raws hauv node JS?

Kev tshwm sim - Tsav Programming yog ib lo lus uas tsuas yog siv thaum xa mus rau qhov ntws ntawm xwm txheej nyob rau hauv ib tug nias, load thiab lwm yam. EDP yog qhov tseem ceeb heev thaum nws los txog niaj hnub no feem ntau programming cov lus zoo li java thiab c#. Hauv Node . js , ib kev tshwm sim tsav txheej txheem yog siv.

Ib yam li ntawd, cov xwm txheej hauv Nodejs yog dab tsi? Node. js xwm

  • Cov xwm txheej hauv Node. js. Txhua qhov kev ua ntawm lub computer yog qhov xwm txheej.
  • Txheej xwm Module. Node. js muaj ib qho module built-in, hu ua "Events", qhov twg koj tuaj yeem tsim-, tua hluav taws-, thiab mloog-koj tus kheej cov xwm txheej.
  • Lub EventEmitter Object. Koj tuaj yeem xa cov neeg tuav haujlwm rau koj tus kheej cov xwm txheej nrog EventEmitter kwv.

Tom qab ntawd, ib tug kuj yuav nug, dab tsi yog qhov kev tshwm sim uas tau tsav lub programming node?

Kev tshwm sim - Tsav Programming Node . js siv xwm txheej hnyav heev thiab nws kuj yog ib qho ntawm cov laj thawj vim li cas Node . js yog zoo nkauj nrawm piv rau lwm yam technologies zoo sib xws. Sai li sai tau Node pib nws cov neeg rau zaub mov, nws tsuas yog pib nws qhov hloov pauv, tshaj tawm haujlwm thiab tom qab ntawd tsuas yog tos rau xwm txheej tshwm sim.

Kev siv EventEmitter hauv node JS yog dab tsi?

Cov EventEmitter yog ib qho module uas txhawb kev sib txuas lus / kev sib cuam tshuam ntawm cov khoom hauv Node . EventEmitter yog lub hauv paus ntawm Node asynchronous kev tshwm sim-driven architecture. Ntau ntawm Node cov built-in modules tau txais los ntawm EventEmitter suav nrog cov txheej txheem tseem ceeb xws li Express. js.

Pom zoo: