Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

297
Visualizações
Proper structure for NPM package containing only typescript models?

I am trying to create a shared project / NPM package that will contain shared typescript models across a couple different projects. I managed to get the package published to GitHub and am able to install it. I can't seem to figure out the correct folder structure and .tsconfig values.

I want to be able to import my models based on the folder they reside in. For example: import { User } from @org/project-name/users

My current folder structure looks like this. enter image description here

Where each model contains something like this export type Organization = {...}

And the index.ts file in each folder aggregates the individual model exports. Like export { Organization } from './organization';

My .tsconfig has the following options set:tsconfig

How can I build the typescript project and publish the npm package in such a way that I can import the correct model based on it's parent folder like mentioned above?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda