
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
serverless-plugin-modularize
Advanced tools
Allows modularized serverless definitions to be merged into a root project. Making decoupled code more config driven and encapsulated.

npm install -D serverless-plugin-modularize
or
yarn add -D serverless-plugin-modularize
In your projects serverless file, add serverless-plugin-modularize to the list of your plugins:
plugins:
- serverless-plugin-modularize
Add the following declaration to the custom definiton of your serverless file:
custom:
modularize:
glob: 'src/**/*.module.yml' # glob pattern
The plugin uses glob patterns to resolve matching modularized files. For a primer on glob usage, visit here. If no glob is provided, the plugin will not merge anything. When matches are found, the result will be dynamically merged into the base serverless.yml definition as required.
modularize infoThe info command can be used to debug what each module is responsible for. In the example here, running the command will produce the following:
$ npx serverless modularize info
modularize: src/goodbye/goodbye.module.yml
{
"functions": {
"goodbye": {
"handler": "src/goodbye/index.goodbye"
}
}
}
modularize: src/hello/hello.module.yml
{
"functions": {
"hello": {
"handler": "src/hello/index.hello"
}
}
}
modularize mergedThe merged command will display what the serverless definition will look like once all the modules are merged:
$ npx serverless modularize merged
modularize: {
"functions": {
"goodbye": {
"handler": "src/goodbye/index.goodbye",
"events": [],
"name": "modular-example-dev-goodbye"
},
"hello": {
"handler": "src/hello/index.hello",
"events": [],
"name": "modular-example-dev-hello"
}
},
"plugins": [
"serverless-plugin-modularize"
],
"custom": {
"modularize": {
"glob": "src/**/*.module.yml"
}
},
"provider": {
"stage": "dev",
"variableSyntax": "\\${([ ~:a-zA-Z0-9._@'\",\\-\\/\\(\\)*?]+?)}",
"name": "aws",
"runtime": "nodejs10.x",
"region": "us-east-1",
"versionFunctions": true,
"remoteFunctionData": null
},
"resources": {}
}
To avoid mutating the base serverless framework, only the following properties are supported when merging. Unfortunately to help in merging, please follow the Expected Type(s) from the table below to avoid collisions between arrays and object.
| Property | Expected Type |
|---|---|
| provider | Object |
| plugins | String[] |
| custom | Object or File Reference |
| functions | Object |
| resources | Object |
A simple example can be found here, showing how two lambda resource definitions can be modularized into one project.
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
FAQs
Modularize your serverless definitions
We found that serverless-plugin-modularize 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.