Suppose in a folder we have files of different extensionsand we want to group them as per their extensions.
- Paste these 2 files in the folder ( where you want to perform the action )
- Run the JS file using NodeJS
- All files except js or json files will be grouped as per extensions