
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
amd-codemod
Advanced tools
A codemod for jscodeshift that will convert amd modules to es6 ones.
// input
define([
"some/module",
"some/other/module"
], (
SomeModule,
SomeOtherModule
) => {
});
// output
import SomeModule from "some/module";
import SomeOtherModule from "some/other/module";
// input
define([], () => {
return 'some-value';
});
// output
export default 'some-value';
// Input
define(['exports'], (
exports
) => {
exports.someProp = "some-value";
exports.anotherProp = "another-value";
});
// Output
export const someProp = "some-value";
export const anotherProp = "some-value";
export default {someProp, anotherProp};
// Input
const myModule = require("some/module");
// Output
import myModule from "some/module";
In the case of webpack you can use require.ensure to load code on demand, with webpack 2 you can do this via System.import.
// Input
require.ensure([], () => {
const myModule = require("some/module");
});
// Output
System.import("some/module").then((someModule) => {
const myModule = someModule;
});
FAQs
Converts amd modules to es6 modules
The npm package amd-codemod receives a total of 3 weekly downloads. As such, amd-codemod popularity was classified as not popular.
We found that amd-codemod 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.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.