netlify-lambda-builder
An experimental CLI and convention for building Netlify functions.
Installation
$ yarn add netlify-lambda-builder --dev
Usage
$ tree src-folder/
src-folder/
├── function-a
│ ├── index.js
│ └── package.json
└── function-b
├── index.js
└── package.json
$ netlify-lambda-builder src-folder --dest functions
# ... some time
$ tree src-folder/
src-folder/
├── function-a
│ ├── index.js
│ ├── package.json
│ └── node_modules
│ └── ...
└── function-b
├── index.js
└── package.json
└── node_modules
└── ...
$ tree functions/
functions/
├── function-a.zip
└── function-b.zip
Running netlify-lambda-builder
will run npm i
inside each function folder it discovers in the source dir. A function folder is a top level folder in the source folder that contains a package.json.