Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming conventions for npm module name

Tags:

npm

Many npm module names that I see have the tech name added in front of them like react-native or jquery etc. Since we already provide keywords in package.json file, is there any advantage to following this convention. I ask this because I am about to release a package to npm and appending react-native to the start of the name is making it too long. Also, the best practices do not mention anything regarding appending the technology name.

like image 902
Saurabh Gour Avatar asked Dec 17 '22 22:12

Saurabh Gour


2 Answers

There is no convention for naming packages with the related tech in the name. Just name it whatever you want as long as it's available and is in-this-format.

like image 107
sdfsdf Avatar answered Feb 23 '23 04:02

sdfsdf


It's completely up to you, people often do this because it helps make it easier and faster to identify what a package is intended for, this is makes things really easy when scrolling through a package.json file and seeing all the react-native packages bundled together in a block.

Some technologies offer websites that let you search through packages related to that application such as gulp and ember which assume a prefix of their respective technology names. But as far as I know, react does not do this.

Ultimately it's up to you, if it's a react only module then perhaps follow the convention and it might yield a few benefits for those using the module. If it's not bound to react or supports multiple platforms, then I'd probably ignore the prefix in favor of easier and more generic branding of the module.

like image 36
Elliot Blackburn Avatar answered Feb 23 '23 03:02

Elliot Blackburn