personal-site
personal-site copied to clipboard
Blog: Use kebab case in package names
Proposed Blog Title
How to name files and directories in JavaScript projects
Title slug*
how-to-name-files-and-directories-in-javascript-projects
Description
Use kebab-case for all package, folder and file names.
Why? You should imagine that any folder or file might be extracted to its own package some day. Packages cannot contain uppercase letters.
New packages must not have uppercase letters in the name. https://docs.npmjs.com/files/package.json#name
Therefore, camelCase should never be used. This leaves snake_case and kebab-case.
kebab-case is by far the most common convention today. The only use of underscores is for internal node packages, and this is simply a convention from the early days.
5 lessons I learned from file names in JavaScript projectsStep-by-step guide to file names in JavaScript projectsFile names in JavaScript projects: It's Not as Difficult as You ThinkA Beginner's Guide to file names in JavaScript projects(This is my favorite)