Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
absolute-module-mapper-plugin
Advanced tools
The plugin on enhanced-resolver to map module path
It's helpful when we need to adjust third-party library dependencies. for example:
We have the follow project directory tree now.
project/
node_modules/
antd/
lib/
components/
icon/
index.js
button/
index.js # requires icon/index.js
...
wrapper/
button/
index.js
icon/
index.js
And the point is antd/button
requires antd/icon
, but we prefer it requires wrapper/icon
which we can customize.
So we could use this plugin in webpack, let antd/icon
in antd/button
is mapped to wrapper/icon
.
npm install absolute-module-mapper-plugin
# or use yarn
yarn add absolute-module-mapper-plugin
const AbsoluteModuleMapperPlugin = require('absolute-module-mapper-plugin')
const webpackConfig = {
resolve: {
plugins: [
new AbsoluteModuleMapperPlugin({
root: '/project',
include: [
'<root>/node_modules/antd/lib/components/button'
],
mapper: {
'^<root>/node_modules/antd/lib/components/icon/index.js': '<root>/wrapper/icon/index.js'
}
})
]
}
}
silent
Show some runtime log
true
root
Assign root path, it is the value for <root>
placeholder.
string
include
The included paths for mapping
Array<string|Function|RegExp>
[options.root]
exclude
The excluded paths for mapping
Array<string|Function|RegExp>
[]
mapper
absolute filename mapper.
(filename, ctx) => string | (filename, ctx, callback) => void | {}
{
'^<root>/from/(\w+)': '<root>/to/$1'
}
requestMapper
request mapper.
(request, ctx) => string | (request, ctx, callback) => void | {}
{
'^./a.js$': './b.js'
}
git checkout -b feature-new
or git checkout -b fix-which-bug
git commit -am 'feat: some description (close #123)'
or git commit -am 'fix: some description (fix #123)'
git push
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
MIT - imcuttle 🐟
FAQs
The plugin on enhanced-resolver to map module path
The npm package absolute-module-mapper-plugin receives a total of 1 weekly downloads. As such, absolute-module-mapper-plugin popularity was classified as not popular.
We found that absolute-module-mapper-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.