get-module-path

get module path

Usage no npm install needed!

<script type="module">
  import getModulePath from 'https://cdn.skypack.dev/get-module-path';
</script>

README

Get Module Path

npm install get-module-path

Use

const getModulePath = require('get-module-path');

const module_name = 'app';
const module_path = getModulePath(module_name); // /home/dev/[sth]/app
const relative_module_path = getModulePath(module_name, __dirname); // node_modules/app

Author

0x0a0d