serverless-plugin-catdir
v1.0.5
Published
Concatinates files in a directory and turns them into a string which can be used in serverless
Readme
serverless-plugin-catdir
Allows serverless stacks to import text from a file or multiple files which will import in a string format. This plugin solves a problem when importing files with new lines that it maintains formatting. This plugin also allows the user to remove
Use case
When importing step function json, this function allows you to have a single or multiple files which contains step function tasks, and retrieve their values with formatting for inclusion in a serverless deployment.
Implementing
Install the plugin into the directory your serverless.yml is located
npm install serverless-plugin-catdirAdd the decouple plugin to your plugins, and add a custom variable to turn it on
plugins:
- serverless-plugin-catdir
custom:
fileContent: "#catdir(./path/to/file.txt)"
fileMaskContent: "#catdir(./path/to/*.txt)"
fileWithoutFirstAndLastLine: "#catdir(./path/to/*.txt,true)"