Hi Cameron, great article!

Do you know how this would work if we had a class with static methods? I'd like to import MyClassName from 'my-npm-package' and then do something like MyClassName.doSomething(), but the import wasn't working after running npm install (in the seperate project where i wanted to use my package) I'm guessing it has something to do with how I need to export / name things in my typescript project.

In the end I used your pattern of exporting function and importing them that way, i.e., import { myfunction } from 'mypackage'

Written by

https://chrisfrew.in 👨‍💻Full Stack Software Engineer 🏠Austria/USA 🍺Homebrewer ⛷🏃‍Outdoorsman

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store