DEV Community

Discussion on: How to create and publish an npm module

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

That's correct but that is fine only if you're exporting a single thing from the file. If you're having more than one thing to export then you need to add that in curly brackets. I used curly brackets so If later, I want to export anything else, its easy to do and the user of the package doesn't need to change the import syntax for every occurrence. Adding all the things to export at the end of the file also makes it easy to find exported things. I hope that clarifies.