https://pulumi.com logo
#typescript
Title
# typescript
b

boundless-monkey-50243

07/25/2019, 2:15 PM
For automatically packaged lambdas, is there a way to work around that you can't capture native code functions? I have a powerful need to work with `Buffer`s. 😕 (Namely, I need
zlib
.)
w

white-balloon-205

07/25/2019, 4:36 PM
You should in generally not need to "capture" them, you should be able to just load them from "inside". As a quite general point, it is worth trying to keep the amount of data that is captured by your automatic lambdas to a minimum. The specifics here likely depend on how your code is structured - but I'd be surprised if you cannot accomplish what you want here by loading the desired librarires inside and capturing only "data" from the ambient environment.
b

boundless-monkey-50243

07/25/2019, 6:35 PM
I'm confused, at least from idiomatic TypeScript. Are you saying to
require()
them inside the lambda environment?
I must be misunderstanding the mechanism behind hoisting libraries (tbh I'm not even sure whether you call doing so capturing, hoisting, etc!). It's pretty magical. 😉
w

white-balloon-205

07/25/2019, 7:43 PM
b

boundless-monkey-50243

07/25/2019, 8:35 PM
Aha. I went looking, but somehow missed that one. Thanks.