
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
babel-plugin-dynamic-import-node
Advanced tools
Babel plugin to transpile import() to a deferred require(), for node
The babel-plugin-dynamic-import-node package is a Babel plugin that transpiles the ECMAScript dynamic import() syntax to a deferred require() call. This transformation allows for code splitting and dynamic module loading in environments that do not natively support the import() syntax. It is particularly useful for server-side applications or tests running in Node.js where dynamic import is not available or practical.
Transpile import() to require()
This feature allows developers to use the dynamic import() syntax in their code, which babel-plugin-dynamic-import-node will transpile into a deferred require() call. This enables dynamic module loading and code splitting in environments that do not support import() natively.
import('path/to/module').then(module => {\n // Use module\n});
This package allows Babel to parse the dynamic import() syntax. However, unlike babel-plugin-dynamic-import-node, it does not transpile import() to require(). It's used in conjunction with other plugins or presets that handle the transformation or in environments that support dynamic imports.
Similar to babel-plugin-dynamic-import-node, this plugin transforms dynamic import() syntax into a require() call. The difference lies in the implementation details and the specific use cases they target. While babel-plugin-dynamic-import-node is focused on Node.js environments, babel-plugin-transform-dynamic-import may offer broader compatibility or different configuration options.
Babel plugin to transpile import()
to a deferred require()
, for node. Matches the proposed spec.
NOTE: Babylon >= v6.12.0 is required to correct parse dynamic imports.
$ npm install babel-plugin-dynamic-import-node --save-dev
.babelrc
(Recommended).babelrc
{
"plugins": ["dynamic-import-node"]
}
$ babel --plugins dynamic-import-node script.js
require('babel-core').transform('code', {
plugins: ['dynamic-import-node']
});
v1.0.1
in-publish
to devDeps (#11)import()
input is properly stringified (#2)babel-template
, babel-types
babel-types
(#4, #5, #6)babel-cli
, babel-core
, babel-eslint
, babel-register
, eslint
, eslint-config-airbnb-base
, eslint-plugin-import
, mocha
, rimraf
FAQs
Babel plugin to transpile import() to a deferred require(), for node
The npm package babel-plugin-dynamic-import-node receives a total of 4,156,734 weekly downloads. As such, babel-plugin-dynamic-import-node popularity was classified as popular.
We found that babel-plugin-dynamic-import-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.