{"_id":"1t","_rev":"4-51d21efeaf4cde7601c20ad3b3c77e36","name":"1t","description":"Ensures that only one instance of your module exists either serverside or in the browser.","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"1t","version":"0.1.0","description":"Ensures that only one instance of your module exists either serverside or in the browser.","main":"1t.js","scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/1t.git"},"homepage":"https://github.com/thlorenz/1t","dependencies":{},"devDependencies":{"tap":"~0.4.3"},"keywords":["singleton","global","#ifndef","pragma"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/1t/blob/master/LICENSE"},"engine":{"node":">=0.6"},"bugs":{"url":"https://github.com/thlorenz/1t/issues"},"_id":"1t@0.1.0","dist":{"shasum":"b3473f03c0a6b577e1f7a580501e472d81de756d","tarball":"https://registry.npmjs.org/1t/-/1t-0.1.0.tgz","integrity":"sha512-9iZSFce80YyQpUL/g7xxI4SEfzY1t9alMQlRyW8BwX0rULE7wg/ziTE4fpbUoepswJgIJyHMDlbDIJO4fPpzzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1v+gqMP1hrx58vXXkmf1cF8IuB4UMfrajeKXZvL+yJQIhANavH40fiucAI/uuEPFM7OaLYoZJO0njd/yYE1Yy9gWZ"}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]}},"readme":"# 1t [![build status](https://secure.travis-ci.org/thlorenz/1t.png)](http://travis-ci.org/thlorenz/1t)\n\nEnsures that only one instance of your module exists either serverside or in the browser.\n\n*1t == [one ton](http://en.wikipedia.org/wiki/Tonne) == a singleton*\n\n```js\nvar singleton = require('1t');\n\n// #ifndef\nsingleton('__FOO__', module, function () {\n// #define __FOO__\n\nvar path = require('path');\n\nexports.hello = 'world';  \nexports.filename = path.basename(__filename);\n\n})\n// #endif\n```\n\n## Installation\n\n    npm install 1t\n\n## API\n\n<!-- START docme generated API please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN docme TO UPDATE -->\n\n<div>\n<div class=\"jsdoc-githubify\">\n<section>\n<article>\n<div class=\"container-overview\">\n<dl class=\"details\">\n</dl>\n</div>\n<dl>\n<dt>\n<h4 class=\"name\" id=\"singleton\"><span class=\"type-signature\"></span>singleton<span class=\"signature\">(id, mdl, fn)</span><span class=\"type-signature\"></span></h4>\n</dt>\n<dd>\n<div class=\"description\">\n<p>Ensures that only one instance for the wrapped module is instantiated.\nWorks similar to <a href=\"http://www.cprogramming.com/reference/preprocessor/ifndef.html\">#ifndef/#define pragmas in C</a></p>\n</div>\n<h5>Parameters:</h5>\n<table class=\"params\">\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th class=\"last\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"name\"><code>id</code></td>\n<td class=\"type\">\n<span class=\"param-type\">string</span>\n</td>\n<td class=\"description last\"><p>the unique id under which the module is stored in the global namespace</p></td>\n</tr>\n<tr>\n<td class=\"name\"><code>mdl</code></td>\n<td class=\"type\">\n<span class=\"param-type\">Object</span>\n</td>\n<td class=\"description last\"><p>the module variable that is passed to each node/browserify module</p></td>\n</tr>\n<tr>\n<td class=\"name\"><code>fn</code></td>\n<td class=\"type\">\n<span class=\"param-type\">function</span>\n</td>\n<td class=\"description last\"><p>function that wraps the code of the module</p></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"details\">\n<dt class=\"tag-source\">Source:</dt>\n<dd class=\"tag-source\"><ul class=\"dummy\">\n<li>\n<a href=\"https://github.com/thlorenz/1t/blob/master/1t.js\">1t.js</a>\n<span>, </span>\n<a href=\"https://github.com/thlorenz/1t/blob/master/1t.js#L7\">lineno 7</a>\n</li>\n</ul></dd>\n</dl>\n</dd>\n</dl>\n</article>\n</section>\n</div>\n\n*generated with [docme](https://github.com/thlorenz/docme)*\n</div>\n<!-- END docme generated API please keep comment here to allow auto update -->\n\n## License\n\nMIT\n","maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"time":{"modified":"2022-06-12T14:06:20.263Z","created":"2014-04-18T18:30:12.647Z","0.1.0":"2014-04-18T18:30:12.647Z"},"homepage":"https://github.com/thlorenz/1t","keywords":["singleton","global","#ifndef","pragma"],"repository":{"type":"git","url":"git://github.com/thlorenz/1t.git"},"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"bugs":{"url":"https://github.com/thlorenz/1t/issues"},"license":{"type":"MIT","url":"https://github.com/thlorenz/1t/blob/master/LICENSE"},"readmeFilename":"README.md"}