Menu

gitpiper

requireUncached javascript Code Snippet in 2024

nodeadvanced

Last Updated: 16 June 2024

Loads a module after removing it from the cache (if exists).

  • Use delete to remove the module from the cache (if exists).
  • Use require() to load the module again.
const requireUncached = module => { delete require.cache[require.resolve(module)]; return require(module); };
const fs = requireUncached('fs'); // 'fs' will be loaded fresh every time

javascript snippet similar to requireUncached For You in June 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️