Skip to content

Commit d7e7f88

Browse files
authored
Update baseline.md
1 parent 6766208 commit d7e7f88

File tree

1 file changed

+20
-17
lines changed
  • content/learning-paths/servers-and-cloud-computing/typescript-on-gcp

1 file changed

+20
-17
lines changed

content/learning-paths/servers-and-cloud-computing/typescript-on-gcp/baseline.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ layout: learningpathall
77
---
88

99
## Baseline Setup for TypeScript
10-
This guide covers the **baseline setup and testing** of TypeScript on a **Google Axion C4A virtual machine** running SUSE Linux. The objective is to ensure that the TypeScript environment is installed correctly, that basic compilation works, and that a simple TypeScript script can run on the VM.
10+
This section walks you through the baseline setup and validation of TypeScript on a Google Cloud C4A (Axion Arm64) virtual machine running SUSE Linux.
11+
The goal is to confirm that your TypeScript environment is functioning correctly, from initializing a project to compiling and executing a simple TypeScript file, ensuring a solid foundation before performance or benchmarking steps.
1112

1213
### Set Up a TypeScript Project
13-
Before testing, we need a project folder with all necessary TypeScript dependencies.
14+
Before running any tests, you’ll create a dedicated project directory and initialize a minimal TypeScript environment.
1415

15-
**1. Create project folder**
16+
1. Create project folder
1617

17-
Create a dedicated folder for your TypeScript project:
18+
Start by creating a new folder to hold your TypeScript project files:
1819

1920
```console
2021
mkdir ~/typescript-benchmark
2122
cd ~/typescript-benchmark
2223
```
23-
This ensures all files are organized in one place, separate from system files.
24+
This creates a workspace named `typescript-benchmark` in your home directory, ensuring all TypeScript configuration and source files are organized separately from system files and global modules.
2425

25-
**2. Initialize npm project**
26+
2. Initialize npm project
2627

27-
Initialize a Node.js project with default settings:
28+
Next, initialize a new Node.js project. This creates a `package.json` file that defines your project metadata, dependencies, and scripts.
2829

2930
```console
3031
npm init -y
3132
```
32-
The above command creates a `package.json` file, which manages your project dependencies and scripts.
3333

34-
**3. Install Node.js type definitions**
34+
3. Install Node.js type definitions
3535

36-
These definitions allow TypeScript to understand Node.js APIs, enabling type checking and code autocompletion.
36+
To enable TypeScript to properly recognize Node.js built-in APIs (like fs, path, and process), install the Node.js type definitions package:
3737

3838
```console
3939
npm install --save-dev @types/node
@@ -56,9 +56,9 @@ You should see output similar to:
5656
```
5757

5858
### Baseline Testing
59-
After setting up the project, we perform baseline testing to verify that TypeScript is working correctly on the GCP SUSE VM.
59+
With the TypeScript environment configured, you’ll now perform a baseline functionality test to confirm that TypeScript compilation and execution work correctly on your Google Cloud SUSE Arm64 VM.
6060

61-
**1. Create a Simple TypeScript File**
61+
1. Create a Simple TypeScript File
6262

6363
Create a file named `hello.ts` with the following content:
6464

@@ -71,17 +71,18 @@ console.log(greet("GCP SUSE ARM64"));
7171
```
7272
This simple function demonstrates TypeScript syntax, type annotations, and basic console output.
7373

74-
**2. Compile TypeScript**
74+
2. Compile TypeScript
7575

76-
The TypeScript compiler (`tsc`) converts `hello.ts` into `hello.js`, which can be executed by Node.js.
76+
Use the TypeScript compiler (tsc) to transpile the .ts file into JavaScript:
7777

7878
```console
7979
tsc hello.ts
8080
```
81+
This generates a new file named `hello.js` in the same directory.
8182

82-
**3. Run compiled JavaScript**
83+
3. Run compiled JavaScript
8384

84-
After compiling the TypeScript file into JavaScript (`hello.js`), you need to execute it using `Node.js`. This step verifies that:
85+
Now, execute the compiled JavaScript using Node.js. This step verifies that:
8586

8687
- The TypeScript code was successfully compiled into valid JavaScript.
8788
- The JavaScript code runs correctly in the Node.js runtime on your GCP SUSE VM.
@@ -93,7 +94,9 @@ node hello.js
9394
```
9495

9596
You should see output similar to:
97+
9698
```output
9799
Hello, GCP SUSE ARM64
98100
```
99-
This verifies the basic functionality of the TypeScript installation before proceeding to the benchmarking.
101+
You have successfully verified that your TypeScript environment is working correctly.
102+
Next, you can proceed to TypeScript performance benchmarking to measure compilation and runtime performance on your Google Cloud Arm64 VM.

0 commit comments

Comments
 (0)