Skip to content

Instantly share code, notes, and snippets.

View ArminBu's full-sized avatar

ArminBu ArminBu

View GitHub Profile
@ArminBu
ArminBu / main.js
Created August 2, 2019 12:19
This script should replace all absolute alias imports with relative imports. It expects 1 argument for the root directory
const path = require("path");
const args = process.argv;
const rootName = args[2];
const rootPath = path.resolve(process.cwd(), rootName);
const alias = "@";
if (!rootPath || !alias) return;
const { promisify } = require("util");