Skip to content

Extensions Submodule > Libraries > SuperAgent

SuperAgent ​

  • Developer: TJ Holowaychuk
  • BrowserType: library

SuperAgent is a lightweight HTTP client for browsers and Node.js.

User-Agent Examples ​

sh
node-superagent/5.0.2

Code Example ​

js
import { UAParser }  from 'ua-parser-js';
import { Libraries } from 'ua-parser-js/extensions';
import { Extension } from 'ua-parser-js/enums';

const libParser = new UAParser(Libraries);
const browser = libParser.setUA('node-superagent/5.0.2').getBrowser();

console.log(browser);
// {name: "node-superagent", version: "5.0.2", major: "5", type: "library"}

// Compare using the built-in enum
const { Library } = Extension.BrowserName;
console.log(browser.is(Library.NODE_SUPERAGENT));
// true

References ​

UAParser.js v2 is licensed under AGPLv3 or PRO licenses.