Menu

gitpiper

requireUncached javascript Code Snippet in 2024

nodeadvanced

Last Updated: 14 December 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 December 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! ✌️