Convert C# script to JS

I’m trying to convert this code to Javascript:

using UnityEngine;
using System.Collections;
using System.IO.Ports;
public class serialRotation : MonoBehaviour
{
    SerialPort stream = new SerialPort("COM3", 57600);


    void Start()
    {
        stream.Open(); //Open the Serial Stream.
    }

    // Update is called once per frame
    void Update()
    {
        string value = stream.ReadLine(); //Read the information

        float memeValue;
        // attempt to parse the value using the TryParse functionality of the integer type
        float.TryParse(value, out memeValue);
        // print(memeValue);
        Vector3 temp = transform.position;
        temp.x = 0;
        temp.y = memeValue /100;
        temp.z = 0;
        transform.position = temp;
       



    }


}

I’ve tried many many times and always got compiling errors.
Anyone could help me please :wink:

I do not believe that JS has access to System.IO.Ports… I could be wrong, but it is complaining about that specifically.

import UnityEngine;
import UnityEngine.Scripting;
import System.IO.Ports;

var stream : SerialPort = new SerialPort("COM3", 57600);

function Start(){
    stream.Open(); //Open the Serial Stream.
}

function Update(){
    var value : string = stream.ReadLine(); //Read the information
 
    var memeValue : float;
    // attempt to parse the value using the TryParse functionality of the integer type
    float.TryParse(value, memeValue);
    // print(memeValue);
    var temp : Vector3 = transform.position;
    temp.x = 0;
    temp.y = memeValue / 100;
    temp.z = 0;
    transform.position = temp;
}

Perfectly working!
thanks a lot!