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.
babel-plugin-replace-exports
Advanced tools
Babel plugin for replace all exports with dynamic values.
Input:
// server/serverApi.js
export function someServerApi(params) {
// server side logic...
}
Output:
import { createAjaxApi as _factory } from '@/lib/createAjaxApi'
var _filename = 'server/serverApi.js'
export var someServerApi = /*#__PURE__*/_factory(_filename, 'someServerApi')
Plugin will remove anything except re-exports.
factory
required, string
.
Factory module name.
Example:
// { factory: 'foo' }
import { default as _factory } from 'foo';
basepath
string
, defaults to cwd
.
Specify basepath for resolving file name.
includes
Array<string>
, defaults to null
.
If specified, plugin will only transpile specific files. It uses micromatch for matching file names.
factoryImportName
string
, defaults to 'default'
.
Import name of the factory function.
Example:
// { factoryImportName: 'myCustomImport' }
import { myCustomImport as _factory } from '@/lib/createAjaxApi';
mapFilename
function
, defaults to v => v
.
Transform filename passed to the factory.
Example:
// { mapFilename: (filename, state) => filename.replace(/\.js$/, '') }
var _filename = 'server/serverApi'
FAQs
Babel plugin for replace all exports with dynamic values.
The npm package babel-plugin-replace-exports receives a total of 0 weekly downloads. As such, babel-plugin-replace-exports popularity was classified as not popular.
We found that babel-plugin-replace-exports 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.