Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
abusing javascript labels 'cause i can
Browse files Browse the repository at this point in the history
  • Loading branch information
jed committed Apr 9, 2011
1 parent a58d5d7 commit a1d952a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ autorequire.js is for the terminally lazy. it turns boilerplate code like this:
into this:

http, https, url, path, util, crypto;

if you want, you can even abuse otherwise useless javascript labels:

require: http, https, url, path, util, crypto;

it does this by wrapping your module in a closure, like this:

Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// using `require.auto` on this file will work as expected

// declare these anywhere in the first tick
assert, repl, url;
require: assert, repl, url;

assert.equal( assert, require( "assert" ) )

Expand Down

0 comments on commit a1d952a

Please sign in to comment.