Fail to load package "randexp"

Hey @lamricky11!

The code served by the CDN is not bundled, which is likely causing this issue as RandExp internally uses ret and drange packages.

I couldn’t find a CDN that provides the bundled version for RandExp but their repository has one. You can try the below snippet and use the lib as required:

const window = {};
eval((await pm.sendRequest("https://raw.githubusercontent.com/fent/randexp.js/refs/tags/v0.5.3/build/randexp.min.js")).text());
const RandExp = window.RandExp;

console.log(new RandExp(/hello+ (world|to you)/).gen());
2 Likes