How to read JSON files dynamically in K6 script

I would like to parameterize the data (list of JSON files) and read the JSON data and send them as part of Websocket messages. I would like to download these files dynamically (from aws s3 bucket) into ‘data’ folder and also unaware of the file names. How can I achieve this? As I understand, I can not use Node JS modules like fs and also I should read them only in InitContext.

Hi @irfanbasha23 :wave:

Welcome to the forum :tada:

I think you can achieve what you’re trying to with the combination of:

Have you tried with them?
I’d be happy to assist you with any further issue (if any) when using those.

Alternatively, bear in mind that you can directly report any issue or feature request in the aws jslib’s repository.

Thanks! :bowing_man: