In our case, our xml builder like templates are javascript modules loaded 
via require. Templates in development mode should not be cached. `delete 
require.cache` works for us.

On Thursday, June 14, 2012 1:12:20 AM UTC-7, Dan Milon wrote:
>
> What is the use case of unloading a module? 
>
> On 06/14/2012 10:02 AM, yogesh agrawal wrote: 
> > delete require.cache is not good way to unload. 
> > 
> > Some times module doesn't get unloaded after deleting it from cache. 
> > Modules api lacks unload method :( 
> > 
> > On Thu, Jun 14, 2012 at 11:28 AM, Ben <[email protected] 
> > <mailto:[email protected]>> wrote: 
> > 
> >     I'm interested in this question too. I tried it once, but all the 
> >     async operations started by the modules remained active even after 
> >     "unloading" it. Try for example a simple setInterval() that writes 
> >     something to the log every second, in the module - when you unload 
> >     the module, the timer is still running. 
> > 
> >     Is there a better way to do it? 
> > 
> > 
> > 
> >     On Wednesday, June 13, 2012 4:40:55 PM UTC-3, Andrew Finnell wrote: 
> > 
> >         I did some research in the group and it appears someone had a 
> >         similar question about unloading modules that were loaded with 
> >         require. 
> > 
> >         Am I correct in reading that the use of nodules would allow me 
> >         to require('./module1') then dump the entire contents of that 
> >         module programmaticly at a later time? Then reload it if I 
> >         felt like it, all within the same node process. 
> > 
> >     -- 
> >     Job Board: http://jobs.nodejs.org/ 
> >     Posting guidelines: 
> >     https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> >     You received this message because you are subscribed to the Google 
> >     Groups "nodejs" group. 
> >     To post to this group, send email to [email protected] 
> >     <mailto:[email protected]> 
> >     To unsubscribe from this group, send email to 
> >     [email protected] 
> >     <mailto:nodejs%[email protected]> 
> >     For more options, visit this group at 
> >     http://groups.google.com/group/nodejs?hl=en?hl=en 
> > 
> > 
> > 
> > 
> > -- 
> > Yogesh Agrawal 
> > +91-9351507770 
> > -- 
> > Job Board: http://jobs.nodejs.org/ 
> > Posting guidelines: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> > You received this message because you are subscribed to the Google 
> > Groups "nodejs" group. 
> > To post to this group, send email to [email protected] 
> > To unsubscribe from this group, send email to 
> > [email protected] 
> > For more options, visit this group at 
> > http://groups.google.com/group/nodejs?hl=en?hl=en 
>
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to