This NodeJS script works as a CLI that tells Dropbox to ignore the node_modules directory.
As per Dropbox Documentation you can see the simple command used to do this.
Install package globally.
npm i dropbox-ignore-node_modules -g
Navigate to the working directory that contains your NodeJS project with the node_modules directory. Then you can run the this script.
You may use the command dropignore
or di
for short.
cd ~/Dropbox/node/project
di
Should work with Windows, MacOS and Linux, however, only tested with MacOS.