As an additional safety check for `node_modules` you could check for the existence of `package.json` in the parent directory.
As an additional safety check for
node_modulesyou could check for the existence ofpackage.jsonin the parent directory.