//lets say you want to find the property on the `resp` object //that contains the url of the request request.get('http://example.com/foo/bar', (err, resp, body) => { console.dir(findMatchingProperty(resp, v => typeof v === 'string' && v.match(/\/foo\/bar/))); }); /** The result is: [ '.request.path', '.request.href', '.request.uri.path', '.request.uri.href', '.request.uri.pathname', '.socket._httpMessage.path', '.socket._httpMessage._header' ] */