This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable @typescript-eslint/no-var-requires */ | |
// this script checks the provided peer dependencies (provided as arguments) if they need to be updated, since npm i doesn't up your | |
// peer dependency versions (this is by design...) | |
// USAGE: node scripts/update-peer-deps.js peerDep1 peerDep2 andSoOn3 | |
// you might need to update your path to your package.json | |
const fs = require("fs"); | |
const { execSync } = require("child_process"); | |
const pkgJson = require("../package.json"); // update me if necessary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WebSocket from "ws"; | |
import { createServer } from "http"; | |
import express from "express"; | |
import cors from "cors"; | |
import compression from "compression"; | |
// Description: | |
// this code demonstrates the use of a HTTP server and WebSocket server on the same Port 8090! | |
// Testing: | |
// -------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-undef */ | |
/* eslint-disable @typescript-eslint/no-var-requires */ | |
var fs = require('fs'); | |
function deleteFolderRecursive(path) { | |
if(!fs.existsSync(path)) return console.log(`${path} does not exist!`) | |
if (fs.existsSync(path) && fs.lstatSync(path).isDirectory()) { | |
// eslint-disable-next-line @typescript-eslint/no-unused-vars | |
fs.readdirSync(path).forEach(function(file, _index){ | |
var curPath = path + "/" + file; |