HOW TO FIx code : ‘ERR_REQUIRE_ESM’ const { nanoid } = require(“nanoid”);

how to fix it ,
I’m doing App chat .
Sorry if the language is difficult to read, I’m Thai.

PS C:UsersADMINDesktopchatserver> node server.js
C:UsersADMINDesktopchatserverserver.js:4
const { nanoid } = require("nanoid");
               ^
[ERR_REQUIRE_ESM]: require() of ES Module 
C:UsersADMINDesktopchatservernode_modulesnanoidindex.js from 
at Object.<anonymous> (C:UsersADMINDesktopchatserverserver.js:4:20) {
code: 'ERR_REQUIRE_ESM'

NodeJS fetch failed (object2 is not iterable) when uploading file via POST request

I’m trying to upload a file using native fetch in NodeJS (added in node 17.5, see https://nodejs.org/ko/blog/release/v17.5.0/).

However, I keep getting the following error –

TypeError: fetch failed
at Object.processResponse (node:internal/deps/undici/undici:5536:34)
at node:internal/deps/undici/undici:5858:42
at node:internal/process/task_queues:140:7
at AsyncResource.runInAsyncScope (node:async_hooks:202:9)
at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: TypeError: object2 is not iterable
at action (node:internal/deps/undici/undici:1660:39)
at action.next (<anonymous>)
at Object.pull (node:internal/deps/undici/undici:1708:52)
at ensureIsPromise (node:internal/webstreams/util:172:19)
at readableStreamDefaultControllerCallPullIfNeeded
node:internal/webstreams/readablestream:1884:5)
at node:internal/webstreams/readablestream:1974:7
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

      

I’m using the following code to create and submit the form response –

function upload(hub_entity_id, document_path) {
  const file_to_upload = fs.createReadStream(document_path);

  let formData = new FormData();
  formData.append("type", "Document");
  formData.append("name", "ap_test_document.pdf");
  formData.append("file", fs.createReadStream("ap_test_document.pdf"));
  formData.append("entity_object_id", hub_entity_id);

  const form_headers = {
    Authorization: auth_code,
    ...formData.getHeaders(),
  };

  console.log(
    `Uploading document ap_test_document.pdf to hub (${hub_entity_id}) `
  );
  console.log(formData);

  let raw_response = await fetch(urls.attachments, {
    method: "POST",
    headers: form_headers,
    body: formData,
  });

  console.log(raw_response);
}

My axios request hangs, but works as expected when I stop the server

I have quite a complex function:

    const getFriends = async () => {
    await axios
        .get(APICallString + id)
        .then((response) => {
            (async () => {
                let p = [];
                for await (const e of response.data) {
                    axios
                        .get(
                            "http://localhost:3002/persons/getById/" +
                                e.friendId
                        )
                        .then((response) => {
                            p.push(response.data);
                        })
                        .catch((error) => {
                            console.log(error);
                        });
                }
                console.log(p);
                setProfileList(p);
            })();
        })
        .catch((error) => {
            errMsg = error.message;
            console.log(error);
        });
    setLoaded(true);
};

This function works as I expected to, but only when I refresh the server. I guess this is because, the request hangs… can someone find out why?

How can I set 2 values for one variable, and the component will render with one value, depending of some prop input

I’m new here, so if my question is no good, please tell me I can edit.

I’m using ReactJS + Material UI. I have a component, but I want this component to be rendered with different properties depending on the props, like this:

in the page where I want render the component:

<AdBanner vertical={true} />

Inside my AdBanner component I have:

export default function AdBanner(props) {
  try {
    if (props.vertical !== true) {
      var adWidth = "100%";
      var adHeight = "90px";
      var adSpacing = 2;
      var adDirection = "row";
    } else {
      var adWidth = "320px";
      var adHeight = "480px";
      var adSpacing = 5;
      var adDirection = "column";
    }
  } catch (error) {
    console.log(error);
  }

My goal is, when I don’t specify a value for the “vertical” property my component has certain characteristics (like height, width, … ). But in some parts of my application I want a set of others values ​​for the same propertiy.

With the current code my application works fine. But I still receive this notification on the console:

  Line 19:11:  'adWidth' is already defined          no-redeclare
  Line 20:11:  'adHeight' is already defined         no-redeclare
  Line 21:11:  'adSpacing' is already defined        no-redeclare
  Line 22:11:  'adDirection' is already defined      no-redeclare

Here the full code:
https://github.com/brunovjk/saude-vapor

Thank you.

CSS position elements along ring of a circle

I’m trying to get elements in a formation relative to a circular parent element like so:enter image description here

Here, there are 5 small squares inside of a larger circle parent. They are equally spaced from each other.

Is there a way to easily make this kind of orientation with JS, CSS, or some other way?
I also wanted this form to be expandable to different number of elements like 6 elements and suc, but I’m not sure where to start.

Adding reset and edit functionality to pomodoro timer

I’ve followed [this tutorial]https://freshman.tech/pomodoro-timer to code a pomodoro timer, with a few changes :

const timer = {
  pomodoro: 25,
  shortBreak: 5,
  longBreak: 30,
  longBreakInterval: 4,
  sessions: 0,
};

let interval;

const mainButton = document.getElementById('js-btn');
mainButton.addEventListener('click', () => {
  const { action } = mainButton.dataset;
  if (action === 'start') {
    startTimer();
  } else {
    stopTimer();
  }
});


const modeButtons = document.querySelector('#js-mode-buttons');
modeButtons.addEventListener('click', handleMode);

function getRemainingTime(endTime) {
  const currentTime = Date.parse(new Date());
  const difference = endTime - currentTime;

  const total = Number.parseInt(difference / 1000, 10);
  const minutes = Number.parseInt((total / 60) % 60, 10);
  const seconds = Number.parseInt(total % 60, 10);
  
  return {
    total,
    minutes,
    seconds,
  };
}

function startTimer() {
  let { total } = timer.remainingTime;
  const endTime = Date.parse(new Date()) + total * 1000;

  if (timer.mode === 'pomodoro') timer.sessions++;
  
  mainButton.dataset.action = 'stop';
  mainButton.textContent = 'stop';
  mainButton.classList.add('active');

  interval = setInterval(function() {
    timer.remainingTime = getRemainingTime(endTime);
    updateClock();

    total = timer.remainingTime.total;
    if (total <= 0) {
      clearInterval(interval);

      switch (timer.mode) {
        case 'pomodoro':

          if (timer.sessions % timer.longBreakInterval === 0) {
            switchMode('longBreak');
          } else {
            switchMode('shortBreak');
          }
          break;
        // Starts pomodoro when break ends
        default:
          switchMode('pomodoro');
      }

      startTimer();
    }
  }, 1000);
}

function stopTimer() {
  clearInterval(interval);
  
  mainButton.dataset.action = 'start';
  mainButton.textContent = 'start';
  mainButton.classList.remove('active');
}



function updateClock() {
  const { remainingTime } = timer;
  const minutes = `${remainingTime.minutes}`.padStart(2, '0');
  const seconds = `${remainingTime.seconds}`.padStart(2, '0');

  const min = document.getElementById('js-minutes');
  const sec = document.getElementById('js-seconds');
  min.textContent = minutes;
  sec.textContent = seconds;

}

function switchMode(mode) {
  timer.mode = mode;
  timer.remainingTime = {

    total: timer[mode] * 60,
    minutes: timer[mode],
    seconds: 0,
  };

  document
    .querySelectorAll('button[data-mode]')
    .forEach(e => e.classList.remove('active'));
  document.querySelector(`[data-mode="${mode}"]`).classList.add('active');

  updateClock();
}

function handleMode(event) {
  const { mode } = event.target.dataset;

  if (!mode) return;

  switchMode(mode);
  stopTimer();
}

const resetButton = document.querySelector(".reset_button");

resetButton.addEventListener("click", function reset(mode){
  
  timer.mode = mode;
  timer.remainingTime = {
    total: timer[mode] * 60,
    minutes: timer[mode],
    seconds: 0,
  };

  const { remainingTime } = timer;
  const minutes = `${remainingTime.minutes}`.padStart(2, '0');
  const seconds = `${remainingTime.seconds}`.padStart(2, '0');

  const min = document.getElementById('js-minutes');
  const sec = document.getElementById('js-seconds');
  min.textContent = minutes;
  sec.textContent = seconds;

  mainButton.dataset.action = 'start';
  mainButton.textContent = 'start';
  mainButton.classList.remove('active');

});

document.addEventListener('DOMContentLoaded', () => {
    switchMode('pomodoro');
});


const setting = document.querySelector(".setting_button");

let toggleSettings = false;
let editableMinutes = document.getElementById("js-minutes").innerHTML;
let editableSeconds = document.getElementById("js-seconds").innerHTML;
let value = null;

setting.addEventListener('click', function () {
  if (!toggleSettings) {
    toggleSettings = true;
    editableMinutes.contentEditable = true;
    editableSeconds.contentEditable = true;
  } 
});
<body>
    <div class="pomodoro">
      <div class="timer">
        <div class="button-group mode-buttons" id="js-mode-buttons">
          <button
            data-mode="pomodoro"
            class="button active mode-button"
            id="js-pomodoro"
          >
            pomodoro
          </button>
          <button
            data-mode="shortBreak"
            class="button mode-button"
            id="js-short-break"
          >
            short break
          </button>
          <button
            data-mode="longBreak"
            class="button mode-button"
            id="js-long-break"
          >
            long break
          </button>
        </div>
        <div class="clock" id="js-clock">
          <span id="js-minutes">25</span>
          <span class="separator">:</span>
          <span id="js-seconds">00</span>
        </div>
        <button class="main-button" data-action="start" id="js-btn">
            start
        </button>
        <button class="setting_button">
            settings
        </button>
        <button class="reset_button">
            reset
        </button>
      </div>
</body>

I want to create buttons that allow users to reset the timer to the initial amount of time for each mode, and edit the session times. I tried but I’m not sure how to I’m new to Javascript.

Performance issues with drawing lots of lines in pixijs

I now need to draw about 300,000 lines in the scene, and then scale it by controlling the parent container. But I find this very laggy, is there anything I can do to improve the optimization performance? I have tried drawing all the lines in one graph, it helps the performance, but it is not enough.

Ajax php mysql loading issue

I’m trying to make a feature when I click on smaller picture to open a bigger one and show me some more additional details beside image itself.
When the small image is clicked it’s firing a function which pulling the id of the picture trough the dataset, and I’m trying send that data to .php file and then load from mysql database but all I get is an error. What am I doing wrong here? Am I doing mistake in js part or php one?

Same thing happens when I try to do it in a jquery version.

Here is vanilla.js version

function modalTitleLoad(e) {

let dataObj = e.target.dataset.id;

let xhr = new XMLHttpRequest();
xhr.open('GET', 'modalTitle.php');

xhr.onload = function () {
    if (this.status == 200) {
        let data = this.response;

        let datapass = dataObj;

        let output = '';
        output += data;

        document.querySelector('.modal__title').innerHTML = output;
    }
};
xhr.send();
}

jquery version:

function modalData(e) {
    let dataObj = e.target.dataset.id;

    $.ajax({
        type: 'GET',
        url: 'modalTitle.php',
        data: {
            datapass: dataObj,
        },
        success: function (data) {
            $('.modal__title').append(data);
        },
    });
}

modalData(event);

and there’s the .php file:

<?php

$datapass = $_GET['datapass'];

$conn = mysqli_connect('localhost','root','','db');

$query = mysqli_query($conn, "SELECT description FROM content where timecode={$datapass}");

$data = mysqli_fetch_all($query, MYSQLI_ASSOC);

echo json_encode($data);

and here is the error:

Warning: Undefined array key "datapass" in C:xampphtdocsProjectmodalTitle.php on line 3

Fatal error: Uncaught TypeError: mysqli_fetch_all(): Argument #1 ($result) must be of type mysqli_result,
bool given in C:xampphtdocsProjectmodalTitle.php:9 Stack trace: #0 
C:xampphtdocsProjectmodalTitle.php(9): mysqli_fetch_all(false, 1) #1 {main} thrown in 
C:xampphtdocsProjectmodalTitle.php on line 9

how to create a DTO of this object in nestJs?

I’m trying to learn NestJs and I’m want to practice it.

I want to learn more about the DTO so I create this sample db.ts and I want to return it using DTO but I don’t know how. can someone help me.

to help you understand what I’m trying to do:
I want to creat a home route (localhost:8080) this route have a controller will return using a service probider the following object but using a dto.

The service Provider function will be like that.

@Injectable()
export class AppService {
    private week = Week;
    getWeek() : WeekResponseDto[] {
        return (this.week);
    }
}

The DataBase:

export let Week = [
    {
        DayName : "TuesDay",
        TimeZone: [
            {
                First: {
                        Start: 18,
                        end: 19,
                        isReserved: false,
                        reserver: "someone"
                },
                Second: {
                        Start: 19,
                        end: 20,
                        isReserved: false,
                        reserver: "someone"
                },
                Third: {
                        Start: 20,
                        end: 21,
                        isReserved: false,
                        reserver: "someone"
                }
            }
        ]
    },
    {
        DayName : "Wednesday",
        TimeZone: [
            {
                First: {
                        Start: 18,
                        end: 19,
                        isReserved: false,
                        reserver: "someone"
                },
                Second: {
                        Start: 19,
                        end: 20,
                        isReserved: false,
                        reserver: "someone"
                },
                Third: {
                        Start: 20,
                        end: 21,
                        isReserved: false,
                        reserver: "someone"
                }
            }
        ]
    },
    {
        DayName : "Friday",
        TimeZone: [
            {
                First: {
                        Start: 18,
                        end: 19,
                        isReserved: false,
                        reserver: "someone"
                },
                Second: {
                        Start: 19,
                        end: 20,
                        isReserved: false,
                        reserver: "someone"
                },
                Third: {
                        Start: 20,
                        end: 21,
                        isReserved: false,
                        reserver: "someone"
                }
            }
        ]
    }
]

Plotly JS How can I draw a line graph that has no beginning before the start point and no end after the last point?

For example I have wrote this code below to generate the following graph:

const trace = {
    x: [-51.0, -50.0, 0.0, 0.6, 0.7, 0.75],
    y: [-100.0, -0.0001, 0.0, 0.0051, 0.0155, 100.0],
    // x: [-50.0, 0.0, 0.6, 0.7, 0.75],
    // y: [-0.0001, 0.0, 0.0051, 0.0155, 100.0],
    type: "scatter",
    mode: "lines+markers",
    name: "diode-curve-graph",
    fill: "tonexty",
  };

  const layout = {
     margin: {
      l: 20,
      r: 10,
      b: 25,
      t: 5,
      pad: 0
    },
    font: {
      size: 11,
      family: "IBM Plex Sans, sans-serif",
      color: "#161b1d"
    },
    modebar: {
      activecolor: "#161b1d"
    },
    xaxis: {
      autorange: true,
      rangemode: "auto",
      zeroline: true,
      ticks: 'outside',
    },
    yaxis: {
      autorange: true,
      rangemode: "tozero",
      zeroline: true,
      tickformatstops: [
        {
          enabled: true,
          dtickrange: [null, 0.01],
          value: ".e"
        },
        {
          enabled: true,
          dtickrange: [0.01, 100],
          value: ".f"
        },
        {
          enabled: true,
          dtickrange: [100, null],
          value: ".e"
        },
      ],
      // ticks: 'outside',
    }
  };

  const config = {
    responsive: true,
    displaylogo: false,
    locale: "pt-BR",
    displayModeBar: false,
    scrollZoom: true
  }

  Plotly.newPlot("diode-curve-graph", [trace], layout, config);

enter image description here

But I’m trying to pass the information that the line is infinity, without beginning and end, like this red line represents:

enter image description here

It could be a simple arrow in the first point and last point pointing to the direction that the lines continues, but I couldn’t do it too.

Thanks in advance!

react native navigation How to make common(shared) component within app screens?

such as tabbar ,appbar or others
i want to implement make component as said in the title.

const App = () => {
  return (
    
      <NavigationContainer>
        <Stack.Navigator initialRouteName="Main" >
          <Stack.Screen name="Main" component={MainScreen} options={{ headerShown: false }} />
          <Stack.Screen name="Analyze" component={AnalyzeScreen} options={{ headerShown: false }} />
          <Stack.Screen name="Write" component={WriteScreen} options={{ headerShown: false }} />
          <Stack.Screen name="Result" component={ResultScreen} options={{ headerShown: false }} />
        </Stack.Navigator>
      </NavigationContainer>
    
  );
};

this is App.js and declared screens.
it dosen’t matter. i want just a shared component.
but i don’t want tricks each component in each screen.
p.s screens are just a blank screen.

<View style={{flex:1,}}><Text>hello world</Text></View>

Popup or new window is not working when I click

In our website, I used window.open to make popup. But it doesn’t work in Microsoft Edge. Before that I was using in Internet Explorer 11 and that method works. But in Edge, it doesn’t work. Also, I’ve checked in the Developer tool and it doesn’t show the error. But, if I right click and make Open in new window or open in new tab, that link opens. It doesn’t open when I left click and open as new window or popup. May I know how can I fix that? I made with onClick=window.open

echo "<td width="" . $cw . "%">";
echo "<a class="l1" title="Product:$tempprod nOper:$tempoper nNoper:$tempnoper nRoute:$temproute nRemark:$commentA nIn:$dateInA" onMouseOver="return overlib('";//modified
echo" ',WIDTH, 50,CAPTION,'<center><b><font class=ft10 color =#ffffff></font><b></center>');"; onMouseOut="return nd();">";
///echo"<FONT class="ft10">$lotA</FONT></a>n";
echo"<FONT class="ft10"><a href="http://sgewsweb.amk.st.com/tools/RackSystem8/carrier.php?site=$site&locid=$loc_id&badgeno=$badgeno&blk=$bb2&row=$rr2&col=$cc2&lot=$LA" onclick="window.open('http://sgewsweb.amk.st.com/tools/RackSystem/carrier.php?site=$site&locid=$loc_id&badgeno=$badgeno&blk=$bb2&row=$rr2&col=$cc2&lot=$LA&carrier=$lotA','popup','width=700,height=300,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" class="l1"  >$lotA</a></FONT>";

Unable to Access Data in JSON Object Javascript with Variable

I am a javascript noob. I have the following function below but for some reason I cannot access the JSON object with the findTokenAddress variable.

Here is my sample code below. An example of a valid findTokenAddress could be: 0x0327112423f3a68efdf1fcf402f6c5cb9f7c33fd.

Which should return:

`{"symbol":"BTC++","name":"PieDAO BTC++","decimals":18,"address":"0x0327112423f3a68efdf1fcf402f6c5cb9f7c33fd","logoURI":"https://tokens.1inch.io/0x0327112423f3a68efdf1fcf402f6c5cb9f7c33fd.png","tags":["tokens"]}`

But for whatever reason this does not work. Could someone tell me what I’m missing here?

function getTokenDetails(findTokenAddress) {

    var url = `https://api.1inch.io/v4.0/1/tokens`;

    var xhr = new XMLHttpRequest();
    xhr.open("GET", url);

    xhr.setRequestHeader("accept", "application/json");

    xhr.onreadystatechange = function () {
        if (xhr.readyState === 4) {

            if (xhr.status === 200) {                

                const jsonResponse = JSON.parse(xhr.responseText).tokens;

                if (findTokenAddress in jsonResponse) {
                    console.log(jsonResponse[findTokenAddress]);

                    const tokenDetails = jsonResponse[findTokenAddress];
                
                    console.log(tokenDetails);

                }
                else {
                    console.log(findTokenAddress in jsonResponse);
                    alert("Could not find token in json?");
                }

            }
            else {
                alert("Error!");
            }
        }

    };

    xhr.send();

}

Heroku build failure when deploying Node.js/React app

I’m working on a React/Node app (using create-react-app) and trying to deploy it using Heroku. When we try to deploy on Heroku, we get the following error about react-scripts:
sh: 1: react-scripts: not found.

We’ve tried referring to similar issues on here but haven’t had any luck finding a solution.
Has anyone else ran into this and found a solution or know what might be causing?

Here’s the full Heroku log and package.json files are below for reference:

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
       1. heroku/nodejs
       2. mars/create-react-app
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  16.x
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 16.x...
       Downloading and installing node 16.15.1...
       Using default npm version: 8.11.0
       
-----> Installing dependencies
       Installing node modules
       
       added 203 packages, and audited 204 packages in 12s
       
       58 packages are looking for funding
         run `npm fund` for details
       
       found 0 vulnerabilities
       
-----> Build
       Running heroku-postbuild
       
       > [email protected] heroku-postbuild
       > cd client && npm run build
       
       
       > [email protected] build
       > react-scripts build
       
sh: 1: react-scripts: not found
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

Here are the package.json files for the app:

Root:

{
  "name": "pool-chem-calculator",
  "version": "1.0.0",
  "description": "Calculator that calculates pool water chemistry based off values in a form",
  "main": "server/server.js",
  "scripts": {
    "start": "if-env NODE_ENV=production && npm run start:prod || npm run start:dev",
    "start:prod": "cd server && npm start",
    "start:dev": "concurrently "cd server && npm run dev" "cd client && npm start"",
    "test": "cd client && npm run test",
    "lint": "npx eslint client/src",
    "heroku-postbuild": "cd client && npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/pschlafley/Pool-Chem-Calculator.git"
  },
  "author": "Peyton Schlafley, Tom Chestnut",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/pschlafley/Pool-Chem-Calculator/issues"
  },
  "homepage": "https://github.com/pschlafley/Pool-Chem-Calculator#readme",
  "devDependencies": {
    "concurrently": "^7.2.0",
    "eslint": "^7.11.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-react": "^7.28.0",
    "prettier": "^2.5.1"
  },
  "dependencies": {
    "if-env": "^1.0.4"
  },
  "engines": {
    "node": "16.x"
  }
}

Client:

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "proxy": "http://localhost:3001",
  "type": "module",
  "dependencies": {
    "@apollo/client": "^3.6.2",
    "@emotion/react": "^11.7.1",
    "@emotion/styled": "^11.6.0",
    "@mui/material": "^5.3.0",
    "@testing-library/jest-dom": "^5.16.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "formik": "^2.2.9",
    "graphql": "^16.5.0",
    "jwt-decode": "^3.1.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-router-dom": "^6.2.1",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.1.2",
    "yup": "^0.32.11",
    "react-device-detect": "^2.1.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Server:

{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "type": "module",
  "scripts": {
    "start": "node server.js",
    "dev": "nodemon server.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "apollo-server-express": "^3.6.4",
    "bcrypt": "^5.0.1",
    "express": "^4.17.3",
    "graphql": "^16.3.0",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^6.2.7"
  },
  "devDependencies": {
    "nodemon": "^2.0.15"
  }
}

how can i make a bookmarklet that uses three.js

I’m making a bookmarklet game and I want it to also be 3d. I want to try adding three.js into it but I can’t find a way on how to do this. I searched it up and couldn’t find anything related to my question.

I don’t know what I did to deserve the dislike but I’m sorry.