Skip to content

Instantly share code, notes, and snippets.

@vv13
vv13 / __dirname.js
Created October 15, 2023 13:22
__dirname in ESModule
import { fileURLToPath } from "node:url"
export const __dirname = () => fileURLToPath(import.meta.url)
@vv13
vv13 / RemoveComments.js
Created February 16, 2024 15:50
Simple remove comments in project
const fs = require("fs");
const path = require("path");
const IgnoreFiles = ["node_modules", ".idea", ".vscode", "package-lock.json", "yarn.lock"];
class RemoveComments {
sourcePath = "";
targetPath = "";
constructor(sourcePath, targetPath) {
this.sourcePath = sourcePath;