Skip to content

Instantly share code, notes, and snippets.

@spawnrider
Created May 9, 2023 13:34
Show Gist options
  • Save spawnrider/f0b035bbde2133c53a891b2ed75f796b to your computer and use it in GitHub Desktop.
Save spawnrider/f0b035bbde2133c53a891b2ed75f796b to your computer and use it in GitHub Desktop.
List of all libraries / modules loaded in memory and filter on a specific lib name
const libs = Object.keys(require('module')._cache);
const filteredItems = libs.filter(item => {
  return item.includes('aLibName');
});
console.log(filteredItems);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment