Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
How to find path to class/interface in TS/JS/Node.js

I need to find path to the file from which the class/interface is exported. Let's say i have a file builder.ts inside ./src folder with following content:

export class Builder {}

And i have index.ts in current directory, with following content:

import { Builder } from "./src/builder";

Later, i might need to know the path to the file, from which Builder class was imported, so i want to have some kind of function, that would take a class/interface/ and return the path to the file where the entity is defined. So i could write something like this in the index.ts file

const path = getPath(Builder)

And path variable should equal to "./src/builder". Is it possible to have this kind of function?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda