nl_tokens: LOAD_AS_DIRECTORY ( X ) 1 . If X / package . json is a file a . Parse X / package . json and look for main field . b . let M = X + ( json main field ) c . LOAD_AS_FILE ( M ) 2 . If X / index . js is a file load X / index . js as JavaScript text . STOP 3 . If X / index . json is a file parse X / index . json to a JavaScript object . STOP 4 . If X / index . node is a file load X / index . node as binary addon . STOP
pl_tokens: function load_as_directory ( request , startpath ) { var resolved_path = path . posix . resolve ( startpath , request ) ; var module_path = _ . find ( registry . directories , function ( <mask> ) { return item . id === resolved_path ; } ) ; if ( module_path ) { return module_path . path ; } }