Module path hook for Node.js require
npm install module-path-hook





> Module path hook for Node.js require
``bash`
npm install module-path-hookor use yarn
yarn add module-path-hook
`javascript
/**
app/
index.js
foo.js
*/
require('module-path-hook/register')({
// See webpack resolve: https://webpack.docschina.org/configuration/resolve/
alias: {
'@app': '/app/'
}
})
require.resolve('@app') === '/app/index.js'
require.resolve('@app/foo') === '/app/foo.js'
`
- require-resolve-hook - Module to hook into the Node.js require and require.resolve function
- require-fallback-middle - Module to fallback the Node.js require and require.resolve function
- Fork it!
- Create your new branch:
git checkout -b feature-new or git checkout -b fix-which-buggit commit -am 'feat: some description (close #123)'
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
or git commit -am 'fix: some description (fix #123)'git push`
- Push to the branch:
- Submit a pull request :)
This library is written and maintained by imcuttle, imcuttle@163.com.
MIT - imcuttle 🐟