Show HN: namespace.js - a 250 byte open source project.
github.com
github.com
I'm hoping that by removing the idiosyncrasies of my earlier version, I can actually get others to adopt this mechanism.
Is it crazy to have such a tiny open source project?
(BTW: the gzipped/minified version of the library is less than 250 bytes - hence the title).
Not particularly. Who cares how much or how little code there is, if it does the job?
Here's my one question (and it's not specific to namespace.js)
How to do imports so I can avoid
var obj = new namespace.com.foo.bar.baz.FooBar(...);
var library = namespace.com.foo.bar.baz;
...
var obj = new library.FooBar();
It's generally considered a best practice (in the Python community) to leave the external module name (like "library", above) so that someone reading your code can recognize which functions are external to your module, and which ones are local.