NMPath
Find the nearest node_modules directory relate to specific directory.
Install
npm install nmpath --save
Usage
const nmpath = require('nmpath');
// If the destFolder is omitted, the directory where the current file is located will be used.
const destFolder = __dirname;
const node_modules = nmpath(destFolder);
console.log(node_modules);
License
Copyright (c) 2019, Owen Luke