lambda-api
lambda-api copied to clipboard
[Feature request] Dependency-free distribution
This package seems really cool and I would love to be able to use it. However, it looks like it pulls in about 20M of dependencies on a fresh install, it looks like mainly owing to the peer dependencies for @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner.
$ mkdir example && cd example
$ npm init -y
$ npm install --save lambda-api
$ du -h node_modules | tail -n 1
# 20M node_modules
For users who may not have a need to interact with S3, is there a way for these dependencies to be eliminated, or for some configuration to be passed in that skips installing these? If these dependencies are required, could the README be updated to reflect that the package is not dependency free?
FWIW, the S3 client is lazy-loaded. If you aren't using the S3 functionality and you are doing some sort of bundling, you can safely mark it as external and omit it.
@perpil gotcha, that's really good to know! I don't spend a lot of time working with JS build systems and consequently was not aware that you could do something like that. I would also note that, right now, the use case we were evaluating this package for did not have or require a build system.
I think the larger issue then may be with the language around this package being dependency-free. Currently there's a section in the README called "Why Another Web Framework" which is unequivocal about this package being dependency-free.
Express.js, Fastify, Koa, Restify, and Hapi are just a few of the many amazing web frameworks out there for Node.js. So why build yet another one when there are so many great options already? One word: DEPENDENCIES.
Lambda API has ZERO dependencies. None. Zip. Zilch.
However, this isn't strictly true. "Dependency-free* (* some assembly required)" is not the same thing as "dependency-free". Maybe the language in the README and elsewhere could be changed to something like "minimal dependencies" or "configurable to zero-deps" to set expectations to the wider public.
Agreed, the S3 functionality was added after that was written and it should be updated.