Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

295
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!