---
# System prepended metadata

title: Running a Node.js program locally V/S Runnning an AssemblyScript program written for NEAR
tags: [tutorials, AssemblyScript, Node.js, NEARprotocol]

---

# Running a Node.js program locally V/S Runnning an AssemblyScript program written for NEAR


## **Objective**: To help beginners understand, how contracts(programs) are deployed on NEAR while drawing comparisons from Web Development  

 

:::info
**Note:** 
This document ==assumes that the readers already have beginner level knowledge of Node.js, AssesmblyScript and NEAR== 
:::




---

 
### A) Steps for locally running Node.js program::memo: 



1. Write and save the program to a '.js' file
2. Run program :rocket:
```AssemblyScript
$ node programFile.js
```
> Node.js programs are interpreted at runtime 


---
 
### B) Steps to deploy an AssesmblyScript program(contract) written for NEAR :memo: 



1. Write and save the program to a '.ts' file
2. Compile the program to a '.WASM' file :astonished:
```AssemblyScript
$ yarn build:release
```
3. Deploy the WASM file to NEAR
```AssemblyScript
$ near deploy --accountId accountname.testnet --wasmFile programFile.wasm
```
4. Run/ Call the program
```AssemblyScript
$ near view accountname.testnet functionName
```


:::info
**Note:** 
All further ==changes to the AssemblyScript program have to saved, re-compiled, re-deployed and re-run on NEAR== 
:::



---

## Summary :notebook: 


| Node.js          | AssemblyScript (NEAR)               |
| ----------------- |:----------------------- |
| Write and save program    | Write and save program   |
| :negative_squared_cross_mark: | Compile program to a WASM file     |
| :negative_squared_cross_mark:  | Deploy the WASM file to NEAR     |
|    Run program    | Call/ Run program(Contract)    | 


---

###### tags: `NEARprotocol` `tutorials` `Node.js` `AssemblyScript`

