Created
May 9, 2023 13:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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