Ai
1 Star 9 Fork 2

思伟/vuepress-plugin-helper-live2d

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
getNodeModulePath.js 486 Bytes
一键复制 编辑 原始数据 按行查看 历史
思伟 提交于 2019-09-20 11:27 +08:00 . 初始化提交并在npm发布1.0.0版本
/**
* @description Resolve the path of provided package name
*/
const path = require('path');
/**
* Resolve the package path according to provided package name
* @param {String} packageName Package need to be resolved
* @return {String} If detected the package, the path; if not, null
*/
module.exports = function getNodeModulePath(packageName) {
try {
return path.dirname(require.resolve(`${packageName}/package.json`));
} catch (e) {
return null;
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zhousiwei/vuepress-plugin-helper-live2d.git
git@gitee.com:zhousiwei/vuepress-plugin-helper-live2d.git
zhousiwei
vuepress-plugin-helper-live2d
vuepress-plugin-helper-live2d
master

搜索帮助