@0ti.me/en-path 中文文档教程
en-path
srelative
// This fails because the path ends up being 'module.js' which require will interpret as an npm dependency instead of a file path
const path = require('path');
const module = require(path.relative(__dirname, 'module.js'));
一个增强的路径模块,它添加了一个相对函数,确保所有路径都可以被要求使用。 你可以在这里看到它的实际效果:
const enPath = require('en-path');
const module = require(enPath.srelative(__dirname, 'module.js'));
en-path
srelative
// This fails because the path ends up being 'module.js' which require will interpret as an npm dependency instead of a file path
const path = require('path');
const module = require(path.relative(__dirname, 'module.js'));
An enhanced path module that adds a srelative function that ensures all paths are usable by require. You can see it in action here:
const enPath = require('en-path');
const module = require(enPath.srelative(__dirname, 'module.js'));
更多
你可能也喜欢
- @0y0/webpack-config-react 中文文档教程
- @2alheure/vue-safe-mail 中文文档教程
- @3yaa3yaa/3jsc 中文文档教程
- @4geit/rct-book-preview-component 中文文档教程
- @aalu1418/sponsored-erc721 中文文档教程
- @abcpros/minimal-slp-wallet 中文文档教程
- @abdulghani/react-promise-modal 中文文档教程
- @abhishek_ranjan/primenumber 中文文档教程
- @ablanc/nakanim-api 中文文档教程
- @abstracter/atomic-release 中文文档教程