MCPcopy Create free account
hub / github.com/fluid-dev/hexo-theme-fluid / resolveModule

Function resolveModule

scripts/utils/resolve.js:5–13  ·  view source on GitHub ↗
(name, file = '')

Source from the content-addressed store, hash-verified

3const path = require('path');
4
5const resolveModule = (name, file = '') => {
6 let dir;
7 try {
8 dir = path.dirname(require.resolve(`${name}/package.json`));
9 } catch (error) {
10 return '';
11 }
12 return `${dir}/${file}`;
13};
14
15module.exports = resolveModule;

Callers 2

resolveHighlightFunction · 0.85
resolvePrismFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected