The jokes about black-hole node_modules folders are true for a reason. Now, such dependence might seem scary, and rightfully so. Return !!obj & (typeof obj = 'object' || typeof obj = 'function') & typeof obj.then = 'function'
Take is-promise for example - sitting at around 10M weekly downloads (mainly from its highly-popular dependents) - with its largest CJS version measuring 5 lines of code (LOCs): module.exports = isPromise You most likely have heard the stories of NPM packages with even less than 20 lines of code, breaking the internet because of the slightest change. It’s not uncommon to see tiny packages have insanely high download stats on NPM. After all, given classNames and React popularity, there’s a high chance that you’ve used it before. The novelty of tiny NPM packagesīut you most likely know it all. classNames and React popularity growthĪs the name implies, it’s primarily meant for dealing with CSS classNames (very common in React and any other JSX-based UI framework), although you can use it for any kind of string concatenation.
This tiny open-source library, originally created by JedWatson, is nothing but a versatile string “concatenator.” Currently sitting at over 6M weekly downloads, it rose to popularity alongside React - the UI library that it’s most commonly used with. Let me contradict the very title of this post from the start by saying that you probably know the classNames library very well.