I had a pre-request script which needs to call “aws-sdk”, as below:
const AWS = require(‘aws-sdk’);
While it reports error: “can’t find ‘aws-sdk’”
I tried to add its cdn as a variable in environment, pls see below two pics
Then added below snippet into pre-request script:
const AWS =pm.environment.get(“aws-sdk”);
But it still shows error: SyntaxError: Unexpected token ‘}’
So any suggestions to use aws-sdk in postman pre-request script
Have a look at the following Collection which shows a few methods for consuming external libraries.
It only really works if the library is fully contained in the CDN.
A lot of these libraries have dependencies on other libraries, and they won’t work.