made the lib detect nodejs/amd etc.