Last active
March 20, 2024 10:05
-
-
Save simonorzel26/27a6f8a3c7445da29b24f5b2d9744f6e to your computer and use it in GitHub Desktop.
Gets all deployed Vercel project links once user is logged in
This file contains 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
// Install vercel cli | |
// npm i -g vercel | |
// log into vercel cli then run this file | |
const { exec } = require("child_process"); | |
exec("vercel project ls", (error, stdout, stderr) => { | |
if (error) { | |
console.log(`error: ${error.message}`); | |
return; | |
} | |
if (stderr) { | |
var expression = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi; | |
var regex = new RegExp(expression); | |
console.log(`${stderr.match(regex).join('\n')}`); | |
return; | |
} | |
}); |
Exactly what I was looking for 🔥
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Install vercel cli
// npm i -g vercel
// log into vercel cli then run this file