Moralis SDK (JavaScript / TypeScript)
The most powerful Web3 library for your backend in Javascript and Typescript.
Features:
- Web3 authentication
- Make Evm API and Solana API calls
- Subscribe to real-time blockchain updates via Streams
- Consistent data types and utilities
- Modular package: include only what you need
- Fully Typescript ready out-of-the box
. and much more. Check the official Moralis docs for more details.
Demos
If you want to see how to integrate Moralis on your codebase, check out our demos
Need help
If you need help with setting up the boilerplate or have other questions — don’t hesitate to write in our community forum and we will check asap. Forum link. The best thing about this SDK is the super active community ready to help at any time! We help each other.
Moralis Web3 Documentation
Integrate Web3 into any tech stack by following easy guides, recipes, and API references!
Explore Our APIs
Get all the blockchain data you need with our highly scalable APIs.
Receive blockchain data by listening to realtime on-chain events.
Authenticate users with their wallet to safely interact with your backend.
Get NFT, token and transaction data from EVM chains.
Fetch user and token data from the Aptos blockchain.
Fetch user and token data from the Solana blockchain.
Node.js Explained – What is Node.js?
It is essential to know about Node.js when building decentralized applications, or dApps. As such, we’ll delve into all the details of Node.js, as well as how you can use it in conjunction with Moralis. If you want to learn more about all the opportunities that arise from smart contract-driven dApps and the advent of Web3, be sure to check out the extensive materials readily available on the Moralis blog and official YouTube channel. In short, Node.js is a programming platform released in 2009 to help manage some of the complexities of JavaScript. It is uniquely suitable for Web development in the age of blockchain.
Specifically, with scalability an ever-growing challenge in this global industry, Node.js gives developers at dApp platforms like Moralis the ability to create high-performing, scalable network applications. Let’s do a deep dive to answer all the important questions including, what is Node.js, what is Node.js used for, and what are its main features? Read on to get the full breakdown of Node.js, its features, as well as how you can use it with Moralis. As you’ll know, Moralis is a next-gen development platform that acts as middleware when building with blockchain.
What is Node.js and why is it important?
Built on Chrome’s JavaScript runtime, Node.js makes it easier for developers to build scalable, high-performance apps. Also referred to simply as “Node”, it is is a framework that has important characteristics:
- It uses an event-driven, non-blocking I/O model. This means that the node process doesn’t lock up the entire web app when retrieving a sole response . It merely moves on to the next event and continually runs until the event queue is empty. Node.js introduces an event model that uses an event loop as a runtime construct, not just a library. This eliminates the need for a blocking call to start an event loop. In this way, it provides a framework that is lightweight, efficient, and highly suited for real-time applications across distributed networks.
- Node.js enhances the use of JavaScript by running both on the client as well as the server-side. It allows web applications to run with real-time two-way connections where both server and client can initiate communications and freely exchange data.
- Developers who run JavaScript-heavy applications benefit from the ability to reuse code without the added burden of context switching between edit and search tools. Node.js packing manager (NPM) is known for code reuse, with over a million packages for developers to use in programming tasks.
Armed with these features, Node.js fits in perfectly with the open-source environment of blockchain development. With public blockchains, real-time data exchange and communication are essential. So is the need for bridges to maintain interoperability with other blockchain-based platforms. It represents yet another advancement as web development evolves to the Web3 environment.
Components of Node.js framework
The components that make up the Node.js framework are the following:
- Google’s v8 JavaScript open-source engine, which runs on iOS, Linux, and Windows.
- The libuv cross-platform platform abstraction layer, which supports asynchronous I/O based on event loops.
- A core library that is written in JavaScript.
As its creator Ryan Dahl described it, Node.js is an “evented I/O for v8 javascript”. Developers across the globe use his innovation when building real-time websites. Both the client and the server can initiate communication, allowing them to exchange data freely. Previously, a typical web response would only allow the client to initiate communication.
What is Node.js used for?
One of the easiest ways to determine “What is Node.js used for” involves discussing some of the problems that Node.js solves for developers. Then we’ll review some of the applications developers can build using this framework.
One significant challenge that Node.js addresses is the inefficiency of OS threads. Let’s take a simple example using a “hello world” configuration written using Node.js as pictured below to see how this manifests.

In the “hello world” example, many connections can be handled concurrently. Upon each connection, the callback is fired, but if there is no work to be done, Node.js will sleep.
As an asynchronous framework, it doesn’t wait for file I/O to complete. Instead, it uses callbacks, which are functions called when a given task is complete. Callbacks help to prevent blocking while allowing other code to run in the meantime. They contrast with OS threads, which are tricky to use and not as efficient. Node.js users benefit from using a framework with no locks, as functions do not perform I/O, eliminating the process of dead-locking.

With the callback system in place, developers are free from blocks while building scalable systems is easier and faster.
Addressing the complexities of JavaScript
The Node.js platform supports the CommonJS standard, which enables modularized development. In this system, software is distributed in packages through a Node Package Manager, or NPM. The NPM acts as an online repository where developers can publish open-source code. It also provides a command-line utility for connecting with the repository for installation purposes and version updates.
Before the introduction of Node.js, an app’s behavior was dependent on callbacks at the start of the script, while at the end a server starts through a blocking call. With it, the event loop start call is not necessary because it just enters the event loop after the input script executes. Then it exits the event loop whenever there are no more callbacks. All the while, the event loop is hidden on the user end.
Recap
Let’s take a quick breather and review:
What is Node.js?
- Node.js is an open-source runtime environment.
- It is useful in building server-side networking apps.
- JavaScript is its language
- Node.js can run on OS, Windows, or Linux.
- With the framework comes a deep library of JavaScript modules making the work of app development simpler and faster.
- Enables applications with real-time 2-way connections and the free exchange of data.
Features of Node.js
- Event-Driven, or Asynchronous – The APIs from the Node.js library are asynchronous, or non-blocking. A server moves right to the next API and doesn’t wait for the API to communicate back.
- Speed – By using Google Chrome’s V8 JavaScript Engine, it enables fast code execution.
- Single-Threaded – A single-threaded model utilizes event looping, which is a much more scalable system. The event mechanism enables a response from the server without blocking. Traditional servers entail limited threads. In this way, a server can service many more requests.
What is Node.js used for?
- Addressing the complexities of JavaScript
- Enabling modulated development
Main advantages of Node.js
As you have already learned, there are many advantages to using the Node.js software development platform. So what is Node.js good for? We’ve seen some of the specifics, now let’s look at the big picture. What does using it mean for developers and the end users that download their applications?

When answering the question, “What is Node.js good for”, it comes down to making a developer’s work quicker and easier. This is partly why Moralis is such a good match for it, seeing as Moralis also supercharges your development process. In fact, Moralis’ fully managed blockchain backend infrastructure allows you to deploy dApps in minutes rather than days.
What types of applications is Node.js used for?
Now we’re getting to the good stuff. What kind of applications and functionalities can developers build using Node.js? Below we’ve compiled a list of the main types of applications, each with a real-world example:
- Data Streaming Applications such as real-time stock trades
- Data-Intensive Real-time Applications (DIRT) such as image processing and web crawling
- JSON APIs-based Applications for data transmittance in web apps, i.e. for displaying a web page
- Single Page Applications such as Google Maps and Netflix
- Static file servers for transmitting videos or images
- Web Application frameworks such as Socket.io for chat apps
- Servers for HTML5 multiplayer games
What is Node.js Not Used for?
Although this is ultimately up to you, it is generally not advisable to use it for CPU-intensive applications such as transcoding tasks or video editing.

Remember that Moralis provides all the tools developers need to build high-performing dApps. Our NPM module has specific versions of its Software Development Kit (SDK) that are designed for using Node.js.

What is a Node.js server?
As you’ve learned by now, Node.js features a runtime environment that uses Chrome’s v8 JavaScript engine. It also includes an HTTP-compatible module that includes all the functions and classes necessary for building an HTTP server.
The Node.js Community
Node.js has a wide global community surrounding it. There are many levels of participation, which are broken down below:
Collaborators
The Collaborators maintain the GitHub repository for Node.js. They are a part of the Technical Steering Committee (TSC), which services the consensus process on an ongoing basis. Developers who make important contributions become Collaborators and are granted commit access to the project.
Top Level Committees
The TSC governs the Node.js project along with the Community Committee (CommComm). TSC is more for high-level guidance while CommComm generally guides the surrounding community.
CommComm also has authority over outreach efforts such as education initiatives, community outreach, project moderation, and translation. The Community Committee has four branches within itself:
- The Contributor can create, comment, and issue a pull request.
- A Collaborator is essentially a Contributor with write access to the Github repository.
- An Observer is simply a person who has requested or been invited to attend a CommComm meeting. This usually is the first step in becoming a Member.
- The Member is a Collaborator who has voting rights. They have met all the requirements for participating and the CommComm must vote them in.

Consensus-Seeking Process
Node.js uses a consensus-seeking model for its decision process. As each agenda item appears to reach consensus, a moderator asks if any of the collaborators object. If consensus still cannot be reached and as long as there are no additional objections, the agenda item goes to a “majority vote wins” system. Generally, voting is the last resort action and usually not necessary.
Other developer participants can join in the efforts to support the larger Node.js community. Localization, evangelism, and working on the Node.js Collection are examples of how to become a part of the community.
How Moralis Fits In
Moralis is quickly establishing itself as the leading middleware for quickly building cross-chain blockchain applications. That is why developers will definitely want to join the community and utilize their Node.js and other web development skills. At Moralis, you will have all the tools you need to build out the next generation of dApps and serverless apps . We are creating the future Internet. We hope you are ready to join us!
Recap
- What is Node.js? – As a programming framework released in 2009, Node.js solves some of the complexities of the JavaScript programming language. It is particularly useful in helping developers build fast, scalable applications.
- What are its main features? – Node.js runs on Google v8 JavaScript engine for speed. Its core library is written in JavaScript. It utilizes an Event Driver or Asynchronous system, which is non-blocking and enables 2-way data sharing.
- What is Node.js used for? – Developers use it to help build high-performance apps with faster response times and real-time data.
- Why should Developers get involved? – It is simple to learn, has wide community support, and is open-source with many easy-to-use, time-saving modules.
From building single-page applications to running data-intensive real-time dApps, Node.js provides a framework that makes sense for Web3 development at Moralis . It provides the speed, agility, and scalability that is crucial when building out blockchain-based dApps. Developers that use Node.js also gain access to the wide base of knowledge and tools available at Moralis.
We hope you gained a lot of knowledge and value from this What is Node.js article. We want to equip every developer with the skills and tools necessary for the blockchain revolution. Let’s take it to the next level together!
JavaScript Explained – What is JavaScript?
You’ve probably heard of JavaScript (JS) before, but can you answer “What is JavaScript”? And even more importantly, do you know what JavaScript is used for? In this article, we take an overview of this popular programming language. Thus, we provide you with all the basics you need to know about it. You will also learn how JS enables you to start developing the most advanced decentralized apps (dApps) fast and easily. That is possible when using the super-powerful platform Moralis. The latter takes care of the back-end aspect of Web3 development. As such, it makes the creation and deployment of decentralized apps fast and much simpler.
If you are interested in becoming one of the most sought-after developers, you should definitely learn to make full use of Moralis . You can create your free account today and start learning. However, since JS knowledge is one of the prerequisites to using Moralis, you need to first learn JavaScript. We’ve previously covered Web3.js and how to use JavaScript in a Web3 context. Nevertheless, this article seeks to dive deeper into the basics of JavaScript, to give a comprehensive overview of what JavaScript is.
Moreover, as Web3 becomes increasingly commonplace, learning JS with an intent to use it for developing dApps makes the most sense. Thus, one of the best courses to learn JavaScript in 2021 and beyond is without a doubt the JavaScript Programming for Blockchain Developers course at Ivan on Tech Academy – sign up today! As such, you’ll be able to make the most of Moralis’ powerful features. Answer the question “what is JavaScript?” and learn to become more proficient with it by reading our comprehensive JavaScript guide!
What is JavaScript?
In short, JavaScript is one of the most popular programming languages. It is primarily used for web programming, and especially making web pages interactive. It achieves this by its ability to update and change both HTML and CSS , which are the backbone of Web2 websites. As JavaScript operates on top of HTML and CSS, JavaScript is often referred to as the third layer of Web2. So, every time you see a webpage do more than just display static content, JavaScript is most likely involved.

Moreover, JS is a text-based coding language. This makes both learning and using it quite intuitive, presuming you know English. By using JavaScript in web development, you are able to create dynamically updating content. That way you are able to control multimedia, animate images, and offer an advanced user experience to the website visitors. Of course, JavaScript is not only used for webpages but more on that later on.
The 3 Layers of Web2 – HTML, CSS, & JavaScript
In order to ensure you get the best understanding of what JavaScript is, basic HTML and CSS understanding is essential. However, before we take a closer look at that, let’s define Web2.
Web2 is the web you know today. It is responsive and dynamic. Web2 are basically all the modern web pages that not only display content but also allow certain interactions. On the other hand, Web3 uses blockchain technology to provide decentralized internet with built-in digital money (e.g. cryptocurrencies) transfer capabilities and smart contracts .

HTML – HyperText Markup Language
HTML is a standard markup language that provides the structure for web content. Only when the content is structured can it provide proper meaning. For instance, defining headings, paragraphs, data tables, embedding images and videos on-page, and much more is done with HTML. People often refer to HTML as the first layer of Web2.
CSS – Cascading Style Sheets
As its name suggests, CSS is all about style. It is used to describe the presentation of a document (e.g. webpage code) written in a markup language. Moreover, it is the coding language that assigns colors, fonts, laying content in columns, and more. Thus, CSS is often referred to as the second layer of Web2.
Learn JavaScript – Quickstart
Considering that JavaScript can calculate, manipulate, and validate data, you need to know a thing or two about JS variables. The latter are essentially containers for storing data values. Moreover, they come in different types, including numbers , strings , objects , arrays , and functions .
Furthermore, variables are defined as ‘var’ (e.g.: var x = 3). The example stores value 3 for variable ‘x.’
JavaScript Numbers
JS considers only one type of number, and programmers may write the numbers with or without decimals. Moreover, it automatically stores numbers as double-precision floating-point numbers. However, the actual maximum number of decimals is 17. Though, the accuracy of the floating-point is not always 100%. For example, defining var x = 0.1 + 0.2 , gives x of 0.30000000000000004.
JavaScript Strings
JS coders use strings to store text. They write them within quotes (e.g.: var carmodel = “Mercedes CLS” or var carmodel = ‘Mercedes CLS’). As you can see, both single and double quotes work just fine. Furthermore, to enable more versatile use of strings, JavaScript comes with many built-in string properties. The most common one is ‘.length,’ which finds the length of a string.
JavaScrip Objects
Looking at the above two variable types, you can see that they can hold only a single value. However, many cases require assigning multiple values to a specific variable. This is what JavaScript objects are for. To define objects, you need to use curly brackets.
Let’s look at the example: var car =
JavaScript Arrays
Similar to objects, JavaScript arrays are also able to store multiple values in a single variable. Instead of using curly brackets, they use square ones. However, they hold multiple values, without the “description” part.
Looking at the following example can illustrate this, as in: var cars = [“Mercedes”, “BMW”, “Ford”]
JavaScript Functions
JS functions are blocks of code that perform particular tasks. In order for a JavaScript function to perform that task, programmers need to determine what will invoke it or “call it.”
Here is a simple example of a function, which will return a product of the two variables when the code invokes it:
function exampleFunction(s1, s2)
We’ve now covered the JS basics, which should give you some clues as to how JavaScript works. Do you find it interesting? It takes some getting used to, but when following clear and simple instructions, you can learn JS very fast. Moreover, as soon as you acquire some basic JavaScript knowledge, you’ll be able to leverage this through Moralis’ serverless Infrastructure-as-a-Service and do everything from build decentralized apps to create Ethereum tokens and much, much more. Be sure to check out Moralis today – it’s completely free!
What is JavaScript Used For?
If you’ve covered the above two sections, you’ll already have a basic understanding of this popular programming language. With that knowledge base, you are ready to take a closer look at what JavaScript is used for.
Primarily, JS is used for web browsers and web-based applications. However, this popular coding language is also used in servers, software, embedded hardware controls, and more. Below we take a closer look at some of the most common use cases.
Adding Interactive Capabilities to Web Pages
When it comes to making basic interactive web pages, JavaScript is the king. The sky’s the limit as you can do basically anything you can think of with JavaScript on a web page. To give you some clues, we list some examples:
- Using a drop-down hamburger menu
- Changing the color of a button on mouse hover
- Ability to slide through a carousel of images (typically on a homepage)
- “Show more info” buttons
- Zooming in/out on an image
- Displaying animations
- Playing a video on a web page
- Playing audio on a web page
Building Web Servers & Server Applications
Developers also have the possibility to use the JavaScript framework for building simple web servers. Using Node.js, JS developers can easily create the back-end infrastructure. Node.js is a JavaScript runtime environment that many popular companies, including LinkedIn, Netflix, Uber, and PayPal use.

Developing Web & Mobile Apps
By using JavaScript frameworks, developers are able to create all sorts of web and mobile apps. Since JS frameworks are collections of JavScript code libraries, they make things much simpler. That way developers have access to pre-written codes for specific features and tasks. Some of the most popular front-end frameworks include Angular, Vue, React, and React Native.
Moreover, thanks to its popularity and a great number of users, JavaScript has extensive and excellently up-to-date code libraries.
Creating Games
Many of the browser games you know and love use JavaScript. In fact, building browser games is a great way for beginner developers to practice their JS coding skills. This can many times lead to simple yet enjoyable online games. If you want to code something akin to an NFT game, however, be sure to use the Moralis NFT API !
JavaScript vs. Other Programming Languages
Nevertheless, there are many other programming languages beyond JavaScript. The simple answer as to why, is that different programming languages have different strengths and use cases. Even though it is always best to strive to learn several programming languages in the long run, you need to start somewhere. For beginners, JavaScript is the one coding language you can benefit from the absolute most. On top of that, you can easily combine it with Moralis and thus immerse in the booming, future-proof blockchain industry super easily.
Here are some of the most important arguments that put JavaScript at the very top:
- It offers an accessible entry point to coding.
- JavaScript is the most popular language according to Stack Overflow (things are popular for a reason).
- If you speak English, it is not too difficult to learn.
- It tends to be fun to learn as it is very interactive.
- Thanks to its popularity, it has very good support (many forums, communities, libraries, etc.).
- There are great debugging tools available for it.
- JS is the premier coding language native to web browsers.
- It is a great foundation to learn other programming styles and languages.
- You can use it with Moralis to develop Web3 applications fast and easily.
Best ‘Learn JavaScript’ Strategy For Beginner Developers In 2021 And Beyond
We at Moralis have a long experience of collaborating with frontend, backend, and full-stack developers. As such, we’ve come up with the best strategy for beginner developers to learn JavaScript. We’ve called it the ‘Learn JavaScript’ strategy. Here is the gist of it:

Step #1: Learn JavaScript
You don’t have to become a JavaScript master straight away. Just learn the basics and start putting it to work – you learn best when you practice. As such, when you come to a point where you need to learn something new, you immediately do so. Luckily there are many high-quality options to learn JavaScript these days.
However, not many include a clear focus on blockchain technology. As such, we honestly dare to say that the course mentioned above is the best option.
Step #2: Use Moralis For Fast & Easy dApp Creation
In case you’ve been living under a rock, you may haven’t heard of blockchain technology yet. But you’ve definitely heard of Bitcoin and cryptocurrencies, right? Well, they are all use cases of the blockchain technology applied in the financial sector.
However, blockchain is much more. It is basically as big of a deal as the invention of the internet, if not bigger. As such, it will disrupt all major industries in the next decade or so. Sooner rather than later, most online operations will make the transition to the decentralized web (from Web2 to Web3).
However, working with Web3 backends can be rather difficult and hugely time-consuming. As such, we’ve decided to create a powerful platform to solve these challenges. Thus, Moralis was born. This super-powerful platform offers full Web3 backend management infrastructure. It is compatible with all major blockchains, and our team is constantly adding new reputable ones.
Here’s a good analogy to grasp what Moralis is: Moralis does for blockchain what Windows and iOS do for PCs, and what AWS does for the internet. Put simply, it’s a huge deal!
Using JavaScript in combination with Moralis, you can devote your attention to the frontend aspect of a project. Moralis solves all the backend challenges for you, with simple lines of code.
What is JavaScript? – Summary
We’ve covered quite a lot in the sections above. You now know that JavaScript is the most popular programming language with multiple use cases. Moreover, it is the only coding language native to Web browsers. We’ve also covered what is JavaScript used for. So at this point, you already know that programmers primarily use it for frontend web pages and web and mobile apps development.
Furthermore, we’ve presented you with some JavaScript basics by looking at JS variables. We also did a quick overview of JS in comparison with other coding languages. The latter helped us determine that it is the best option for beginner developers. As such, we’ve presented you with the ‘Learn JavaScript’ strategy. In addition, you’ve also learned about Moralis, the ultimate Web3 development platform, where you can create dApp with JavaScript fast and easily. That’s quite a lot of useful information, so make sure to put it to use. Kickstart your dApp development with just JavaScript and Moralis today!