Export class vs. export function for creation

Viewed 86

I notice some libraries expose a function to user for creating instance, while some other expose a class directly. For example, Vue.js uses new Vue(...) to create a new instance, and Express.js uses express() to initialize. Currently I am writing a libary for my company, and I cannot decide which one I should choose. What are the pros and cons of these two design style? And what should I prefer to use?

0 Answers
Related