Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    Node.js : Introduction - Part 1

    Back-End Development
    node-js backend javascript
    8
    8
    2601
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sudo FOSS last edited by


      alt text

      Node.js කියන්නේ මොකක්ද?
      Node.js කියන්නේ javascript වලට web browser එකෙන් එලියේ වැඩ කරන්න ඉඩ දෙන run time environment එකක්. සරලවම කියනවනම් මේකෙන් වෙන්නේ සාමාන්‍ය programming language එකක් වගේ වැඩ කරන්න javascript ට ඉඩ හදල දෙන එක.

      Node වල පාවිච්චි වෙන්නේ chromium project එකෙන් එන V8 javascript engine එක. Google chrome ඇතුලෙත් පාවිච්චි වෙන්නේ මේකම තමයි.

      ඇයි මේක ගොඩක් ජනප්‍රිය?
      Node ගොඩක් ජනප්‍රිය වෙලා තියෙන්නේ ගොඩක්ම මේක පාවිච්චියේ තියෙන පහසුව නිසා. තව Technical හේතුත් තියෙනවා (event driven, non-blocking, asynchronous.. bla bla bla) ඒවා ගැන ඉස්සරහට කතා කරමු.

      පහසුව කියලා මම කියන්නේ front end සහ back end එකේ එකම language එකක් භාවිතයේ පහසුව. ඒවගේම මේකත් එක්ක පාවිච්චි කරන්න පුලුවන් libraries එහෙමත් නැත්තම් දැනටමත් programmers ලා ලියලා තියෙන code ප්‍රමාණය ඉතාමත් වැඩි වීම.

      ඒවගේම electron වගේ framework නිසා node පාවිච්චි කරලා desktop application ලිවීමේ හැකියාවත් ලැබිලා තියෙනවා.

      සාමාන්‍ය javascript මද මේකෙ පාවිච්චි වෙන්නේ?
      ඔව්. ඒත් සාමාන්‍ය javascript වලදී අපි කරන්නෙ dom එක සම්බන්ද වෙනස්කම් නේ. ඒත් node වලදී අපිට dom එකක් නෑ. ඒ වෙනුවට file system එක, os එක එක්ක අපිට වැඩ කරන්න පුලුවන්.

      කොහොමද ඉගෙන ගන්න පටන් ගන්නෙ?
      www.nodejs.org වලට ගිහින් තමන්ගේ platform එකට අදාලව nodejs download කරගෙන install කරගන්න. තව instruction official page එකේ තියෙනවා.

      Debian/Ubuntu/Ubuntu flavors වල නම්

      sudo apt install nodejs npm
      

      Arch නම්

      sudo pacman -S nodejs npm
      

      හරහා ඔයාලට ලෙසීයෙන් nodejs + npm install කරගන්න පුලුවන්.

      කොහොමද පාවිච්චි කරන්නෙ? (Hello World example)

      • අලුතෙන් directory එකක් හදන්න.

      • ඒකේ helloworld.js කියලා file එකක් හදන්න.

      • ඒක ඇතුලේ සාමාන්‍ය විදියටම,

      console.log("Hello World");
      

      කියලා type කරලා save කරන්න.

      • දැන් අදාල directory එකට ඔයාගේ command line shell එකෙන් යන්න (CMD/Terminal).

      • දැන් node helloworld.js කියලා run කරන්න.

      ඔයාට hello world කියලා print වෙනවා බලාගන්න පුලුවන්. ඕක තමයි හැම programming language එකේම වගේ තියෙන hello world example එක.

      1 Reply Last reply Reply Quote 7
      • root
        root Linux Help last edited by

        ohh. nice bro. welcome to the lankadevelopers.

        1 Reply Last reply Reply Quote 1
        • dev_lak
          dev_lak last edited by

          good post :hearts:

          1 Reply Last reply Reply Quote 0
          • P
            Prince92 last edited by

            Good job.. Refreshing node basic...

            1 Reply Last reply Reply Quote 0
            • Danuva
              Danuva last edited by

              Thnx bro, wating for the next part. post it immediately

              1 Reply Last reply Reply Quote 1
              • dinlinux
                dinlinux last edited by

                නියමයි. පැහැදිලි හා සරල විග්‍රහයක්

                1 Reply Last reply Reply Quote 0
                • isuru mahesh perera
                  isuru mahesh perera last edited by

                  node js <3

                  1 Reply Last reply Reply Quote 1
                  • Muhammad Hammad 0
                    Muhammad Hammad 0 last edited by

                    Building reliable back-end applications with Node.js often requires long hours of focused coding and system troubleshooting, which makes having a comfortable, supportive workspace or relaxation area at home essential for developers. After wrapping up a complex asynchronous debugging session, stepping away from the desk to unwind on a spacious leather sectional sofa offers a durable and comfortable spot to recharge before tackling the next sprint. https://www.sohomod.com/leather-sectional-sofas

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post

                    20
                    Online

                    50.1k
                    Users

                    7.1k
                    Topics

                    12.4k
                    Posts

                    • Privacy
                    • Terms & Conditions
                    • Donate

                    © Copyrights and All right reserved Lanka Developers Community

                    Made with in Sri Lanka

                    | |