Observed since 20 Oct, 18:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Ensures that only one instance of your module exists either serverside or in the browser.

Ensures that only one instance of your module exists either serverside or in the browser.
1t == one ton == a singleton
var singleton = require('1t');
// #ifndef
singleton('__FOO__', module, function () {
// #define __FOO__
var path = require('path');
exports.hello = 'world';
exports.filename = path.basename(__filename);
})
// #endif
npm install 1t
Ensures that only one instance for the wrapped module is instantiated. Works similar to #ifndef/#define pragmas in C
| Name | Type | Description |
|---|---|---|
id | string | the unique id under which the module is stored in the global namespace |
mdl | Object | the module variable that is passed to each node/browserify module |
fn | function | function that wraps the code of the module |
generated with docme
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0Registry latest | 18 Apr 2014 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:d985bba6f2fea02957f95f4f187f0200e894946077ae3917e0b68706c4c86d67