Make a function or method callable only once. Useful for initialization methods that may be lazily invoked from several locations, but must only be called once, otherwise the method is a noop.
$ component install component/once
varonce=require('once');Foo.prototype.setup=once(function(){// expensive stuff here});MIT