How to integrate external npm package

Hey @thefierycoder :wave:

As I understand it, you want to convert collection file to OpenAPI spec file using this library, correct?

In general, you can download an external library using pm.sendRequest and evaluate it with eval() as shown in an example here.

But you cannot directly access local filesystem from scripts in Postman due to security reasons as mentioned here, so it would be quite challenging to use that library from test scripts in Postman (the only workaround would be to set up a local server that access to your local file system and call the server from Postman).

Hopefully this clarifies a bit. Please do feel free to let me know if anything in my response needs further clarification :slightly_smiling_face:

1 Like