Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

moving stuff back where it should've been

  • Loading branch information...
1 parent 419a799 commit 677d5953e1be0ddab02e7ca39b8449cba65c64c3 @substack committed
0  lib/bufferlist.js → bufferlist.js
File renamed without changes
0  lib/bufferlist/binary.js → lib/binary.js
File renamed without changes

4 comments on commit 677d595


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"

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.


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.
Something went wrong with that request. Please try again.