Browse files

moving stuff back where it should've been

  • Loading branch information...
1 parent 419a799 commit 677d5953e1be0ddab02e7ca39b8449cba65c64c3 @substack committed Jul 8, 2010
Showing with 0 additions and 0 deletions.
  1. 0 {lib → }/bufferlist.js
  2. 0 lib/{bufferlist → }/binary.js
File renamed without changes.
File renamed without changes.

4 comments on commit 677d595

lygaret commented on 677d595 Jul 8, 2010

If you wanted to put bufferlist.js in the lib directory, you're allowed to do that by changing the main key in the package.json to be "./lib/bufferlist.js". npm will make whatever file is listed as main requirable as the name of the library, no matter where it exists in the tree. The way I would set things up, would be like this


And in package.json:

"main": "./lib/bufferlist.js",
"directories": {
    "lib": "./lib"
lygaret commented on 677d595 Jul 8, 2010

Oops forgot to finish: if you set things up like that, after you install the package with npm, you'd still be able to require things with "bufferlist" and "bufferlist/binary", even though in the source repo the files are in the directory.

lygaret commented on 677d595 Jul 8, 2010

You can see an example in my nerd-router repo: thanks for taking my pull request!!


I was mostly messing with that stuff since the binary tests require('bufferlist/binary') and I wanted that to point to the working version, but I just made a symlink locally instead. This looks like a better way to do it though, I'll check out nerd-router!

Please sign in to comment.