This content originally appeared on Bits and Pieces - Medium and was authored by Kyle DeGuzman
Today we’re learning about Node.js. It’s a tool that every developer will eventually experiment with so let’s learn about what it is and what you can do with it.
What is Node.js?
Node.js is an open-source runtime environment. And as their official website states, this environment was “built on Chrome’s V8 JavaScript engine.”
To understand what all that means, we need to understand a few things.
When JavaScript was first created, it was a scripting language that was intended to be used primarily and singularly within internet browsers. It was meant for websites and web applications.
However, with the introduction of Node.js, developers can now use JavaScript to program APIs, web servers, mobile apps, and even games. Developers can now use JavaScript to build standalone applications that exist outside of internet browsers.
What is a runtime browser
When JavaScript is executed in the browser, the browser is not the essential player that is compiling your JavaScript. Instead, browsers rely on JavaScript Engines.
The Google Chrome browser uses the V8 Engine. The Safari Browser uses the Nitro Engine. Mozilla Web Browser uses the SpiderMonkey engine.
Needless to say, if we want to build standalone JavaScript applications that exist outside of web browsers, we need a JavaScript Engine that also exists outside of web browsers. We need a player that can actually execute our JavaScript.
Node.js is a JavaScript Engine — or you can call it a runtime environment. This tool allows us to build JavaScript programs that can exist outside of web browsers.
Note: You can install Node.js from their official page to get started.
Assuming all that makes sense, you now know of the most basic tool you need to build standalone applications.
Now we can talk about npm.
npm
npm is an initialism that stands for Node Package Manager — emphasis on package manager. If it isn’t obvious, it manages packages. You might also hear people call them modules, libraries, or maybe frameworks.
Regardless, these packages can be deployed in your projects to make that coding process a billion times easier. You can borrow functions from different packages to achieve results faster and cleaner.
For example, in my most recent project, I used a package that can read data from Google Sheets and store that data in a JavaScript object. Without that package, I would not know how to do it myself.
Or you can use the Gulp package to minify your CSS and JavaScript files. (Minify means to reduce the file size).
Or there is also many packages to convert SCSS files to CSS. There are so many packages — built by the community — that do many different things. It’s good to experiment with new packages.
So as previously mentioned, packages make the coding process a billion times easier.
If you want to search for packages, you can check out their official website. There is also a GitHub page that showcases the Top 1000 packages that are being used. Maybe that will be more helpful so you understand why people love packages.
And to use these packages, there is the documentation for everything. It’s very easy. Check out the official npm websites for the documentation. I also know many of these packages also have an official GitHub repository with documentation.
Try it out for yourself, and maybe Node.js will become your new best friend.
Build modular, reusable Node.js components with Bit.
Monorepos are a great way to speed up and scale app development, with independent deployments, decoupled codebases, and autonomous teams.
Bit offers a great developer experience for building component-driven monorepos. Build components, collaborate, and compose applications that scale. Our GitHub has over 14.5k stars!
Learn more
- Building a React Component Library — The Right Way
- 7 Tools for Faster Frontend Development in 2022
- Microservices are Dead — Long Live Miniservices
An Introduction to Node.js and npm was originally published in Bits and Pieces on Medium, where people are continuing the conversation by highlighting and responding to this story.
This content originally appeared on Bits and Pieces - Medium and was authored by Kyle DeGuzman
Kyle DeGuzman | Sciencx (2022-01-14T11:36:17+00:00) An Introduction to Node.js and npm. Retrieved from https://www.scien.cx/2022/01/14/an-introduction-to-node-js-and-npm/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.