Skip to content
Browse files

-

  • Loading branch information...
0 parents commit 3f272bbd9e99ae5acb653324866b21fda71b040a @JoeHitchens JoeHitchens committed Sep 16, 2011
Showing with 79 additions and 0 deletions.
  1. +19 −0 LICENSE
  2. +34 −0 index.js
  3. +17 −0 package.json
  4. +9 −0 test.js
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright 2011 Sleepless Software Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
34 index.js
@@ -0,0 +1,34 @@
+/*
+Copyright 2011 Sleepless Software Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+*/
+
+// yes, I know this seems stupid, but I have my reasons.
+
+module.exports = function(s) {
+ var m = require(s)
+ for(k in m) {
+ if(k.length >= 4) {
+ global[k] = m[k]
+ }
+ }
+}
+
+
17 package.json
@@ -0,0 +1,17 @@
+{
+ "name": "net",
+ "version": "1.0.0",
+ "description" : "Globalizes the 'net' module functions",
+ "author": "Joe Hitchens <joe@sleepless.com> (sleepless.com)",
+ "license": {
+ "type": "MIT",
+ "url": "https://github.com/sleeplessinc/net/raw/master/LICENSE"
+ },
+ "repositories": [
+ {
+ "type": "git",
+ "url": "https://sleeplessinc@github.com/sleeplessinc/net.git"
+ }
+ ],
+ "repository": "git://github.com/sleeplessinc/net.git"
+}
9 test.js
@@ -0,0 +1,9 @@
+
+var globalize = require("./index.js")
+
+globalize("util")
+
+console.log(typeof inspect)
+console.log(typeof log)
+
+

0 comments on commit 3f272bb

Please sign in to comment.
Something went wrong with that request. Please try again.