Skip to content

Instantly share code, notes, and snippets.

View JuanFelix88's full-sized avatar
🏠
Working from home

Juan Felix JuanFelix88

🏠
Working from home
View GitHub Profile
@JuanFelix88
JuanFelix88 / verify-npm-libraries.mjs
Last active May 13, 2026 12:24
Check for leaked npm packages @TanStack and related packages.
#!/usr/bin/env node
/**
* @example node verify-npm-libraries.mjs --root localfolder --csv csv-file.csv --only-likely
*
* Plan with libraries affecteds:
* @link https://docs.google.com/spreadsheets/d/157SIcf-VSpb4VF_DlpppsG9GanNk6LorakSQgUEW99c/edit?usp=sharing
*/
import { access, readdir, readFile } from 'node:fs/promises';
import path from 'node:path';
@JuanFelix88
JuanFelix88 / getName.ts
Last active February 7, 2020 22:04
Get variable name by call stack in NODE.JS (unsafe code)
import fs from "fs";
import { resolve } from "path";
function getVarName(variable: any): string {
const stack2: string = new Error().stack.split(/at/g)[2].trim();
const splitted = stack2.substr(20, stack2.length - 21).split(/:/);
const lineAndPosition = splitted.slice(2).map(item => parseInt(item));