{"_id":"autoload","_rev":"9-1a1944578fd4cf603b9ca15e6a9b7c9a","name":"autoload","description":"Autoloading symbols via source code grokking","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"autoload","version":"0.1.0","description":"Autoloading symbols via source code grokking","keywords":["autoload","require"],"homepage":"https://github.com/laverdet/node-autoload","author":{"name":"Marcel Laverdet","email":"marcel@laverdet.com","url":"https://github.com/laverdet/"},"main":"autoload","repository":{"type":"git","url":"git://github.com/laverdet/node-autoload.git"},"_id":"autoload@0.1.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.15","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"1e402e46c143714e17e5d3ac1b1b600cfb0f0670","tarball":"https://registry.npmjs.org/autoload/-/autoload-0.1.0.tgz","integrity":"sha512-74zDUrLcsvJK9b4GsGpg8raeHSSIzE/RRmmssk6xOi4Bdjn6HgYLaZjLghjExACoHCL+XCXP19hA44l6Qc/+YA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHiRT7p0exobVpulzSi1ck/EimSAglPOqlGoBvhCDVZHAiEA7AVRtxz6iAjKOEm/prmr38i/XygOe5ipuslnrV0vGHg="}]}},"0.1.1":{"name":"autoload","version":"0.1.1","description":"Autoloading symbols via source code grokking","keywords":["autoload","require"],"homepage":"https://github.com/laverdet/node-autoload","author":{"name":"Marcel Laverdet","email":"marcel@laverdet.com","url":"https://github.com/laverdet/"},"main":"autoload","repository":{"type":"git","url":"git://github.com/laverdet/node-autoload.git"},"_id":"autoload@0.1.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.15","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"15f1d76ffc85cc79a8393b9096567598c340654b","tarball":"https://registry.npmjs.org/autoload/-/autoload-0.1.1.tgz","integrity":"sha512-Pl2jm5k+R8inZUVPQFQQzl8MGzLQrxNhjCwFjm2qs3sSffyGJkESzlAyvYSQ4J/JKeuR1t9W9e/MRbpoTpfklA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDABfa+fr1ork+J3bGEg3LtztpU2OP6daRih1kVQcCkFAiBntuIn7Y80CAYRscUHOg6j+9S//dMCm7JS/nBbYUFdgA=="}]}},"0.1.2":{"name":"autoload","version":"0.1.2","description":"Autoloading symbols via source code grokking","keywords":["autoload","require"],"homepage":"https://github.com/laverdet/node-autoload","author":{"name":"Marcel Laverdet","email":"marcel@laverdet.com","url":"https://github.com/laverdet/"},"main":"autoload","repository":{"type":"git","url":"git://github.com/laverdet/node-autoload.git"},"bugs":{"url":"https://github.com/laverdet/node-autoload/issues"},"_id":"autoload@0.1.2","dist":{"shasum":"99340b4f1b2a2bc2825a7abf651117dcabdd0c31","tarball":"https://registry.npmjs.org/autoload/-/autoload-0.1.2.tgz","integrity":"sha512-SeMTiwY5p9c+3nIdT2DdIhJZj0BKwcSuqOLCg2MwV6qWmo5jDEgIugEFdhJIUYUTJ428RV49Ik5UkpmzM1k0gw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID3vXbA0L2tZfzOZQt8pcBxFaDuveJCforBDcfn4MViNAiAXQJm6ezbsjL82Qdis6D1OsJ+7qOMefa+wp2q71WLVmQ=="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"laverdet","email":"marcel.npm@laverdet.com"},"maintainers":[{"name":"laverdet","email":"marcel.npm@laverdet.com"}]}},"maintainers":[{"name":"laverdet","email":"marcel.npm@laverdet.com"}],"time":{"modified":"2022-06-13T03:50:12.780Z","created":"2011-03-10T17:05:06.780Z","0.1.0":"2011-03-10T17:05:07.481Z","0.1.1":"2011-03-20T05:52:44.217Z","0.1.2":"2014-02-16T04:29:30.393Z"},"author":{"name":"Marcel Laverdet","email":"marcel@laverdet.com","url":"https://github.com/laverdet/"},"repository":{"type":"git","url":"git://github.com/laverdet/node-autoload.git"},"readme":"autoload -- Automatically load symbols in NodeJS\n================================================\n\nINTRODUCTION\n------------\n\nIn NodeJS, and CommonJS in general, it's difficult to depend on common globals to be defined when\nyou need them. This has led to very chatty or verbose boilerplate in applications to grab handles\nto functions and objects in every module in a project.\n\nGenerally module exports are used to define pseudo-classes or pseudo-namespaces which make sense as\nas globals. The problem is that even if your module defines its exports as global there's no way to\nbe sure the module you depend on has been required or not. `autoload` attempts to ease this\nsituation.\n\n\nINSTALLING\n----------\n\n\t\tnpm install autoload\n\n\nGETTING STARTED\n---------------\n\nIn your top-level script, call `autoload` and `registeredGlobalsAutoloader` to initialize a typical\nautoloading environment:\n\n\t\tmain.js:\n\t\tvar autoload = require('autoload');\n\t\tautoload.autoload(__dirname, [autoload.registeredGlobalsAutoloader(require)], function() {\n\t\t\t<< your regular code goes here >>\n\t\t});\n\t\t<< don't put code here, as autoload is not ready yet! >>\n\n\nTo register a global as autoloadable, in another module you would do:\n\n\t\tmy-global-function.js:\n\t\tregisterGlobal(function MyGlobalFunction() {\n\t\t\t<< function here >>\n\t\t});\n\n\nWhen you call `autoload` it will search `__dirname` for Javascript files and attempt to find all\nglobals which could be defined (via `registerGlobal`). After it finds those symbols it registers\nautoloading getters on the global object (but does not actually require the module). When the getter\nis invoked the module is require'd and the symbol is returned.\n\nBe sure to look at the source code for `registeredGlobalsAutoloader`, as you can use this library to\nautoload symbols in scopes outside of global as well, or you can implement your own global exporting\npattern too. For instance of you prefer `global.MySymbol = ...` or `MySymbol = ...` you could wire\nthat up. I prefer having the global be super explicit which is why I made registerGlobal().\n","readmeFilename":"README.md"}