How to use the USER_AGENT function from urllib

Find comprehensive JavaScript urllib.USER_AGENT code examples handpicked from public code repositorys.

6
7
8
9
10
11
12
13
14
15
16
17
const utils = require('./utils');
const cnpmConfig = require('./cnpm_config');


module.exports = get;


const USER_AGENT = 'npminstall/' + require('../package.json').version + ' ' + urllib.USER_AGENT;
const MAX_RETRY = 5;
const cacheable = new CacheableLookup();
const httpclient = new urllib.HttpClient({
  lookup: cacheable.lookup,
fork icon63
star icon478
watch icon0

+ 12 other calls in file

69
70
71
72
73
74
75
  agent: httpAgent,
  httpsAgent: httpsAgent
});


module.exports = client;
module.exports.USER_AGENT = urllib.USER_AGENT;
fork icon4
star icon2
watch icon0