This chapter will help you configure your JavaScript workspace for working with Decentralized Web Nodes (DWN). Follow these steps to set up your development environment:
Prerequisites
- Node.js version 18 or above installed on your system
-
Node Package Manager (npm) installed and added to your system's
$PATH
.
Step 1 : **Open your terminal, create and change the working directory
and :**
mkdir web5-dwn
cd web5-dwn
Step 2 : Initialize a package.json
file using NPM:
npm init -y
This will create a package.json
file in your project.
Step 3 : Install Web5 using NPM:
npm install @web5/api@0.11.0
Step 4 : Open the project in your preferred code editor (e.g., VSCode):
code -r .
Step 5 : Edit the package.json
file to include "type": "module"
so your project recognizes JavaScript modules:
{
"dependencies": {
"@web5/api": "0.11.0"
},
"type": "module"
}
Step 6 : Create an index.js
file for your application logic:
touch index.js
For Windows using PowerShell:
New-Item index.js -ItemType File
At this point, your workspace and package.json
file should look like this:
Top comments (0)