{"id":18273,"library":"default-user-agent","title":"default-user-agent","description":"Generates a default User-Agent string for Node.js HTTP requests. Version 1.0.0 is stable but unmaintained since 2015. It outputs strings like 'Node.js/<version> (<os>; <arch>)' and accepts optional app name and version (e.g., 'urllib/0.0.1 Node.js/...'). Unlike modern packages like 'useragent' or 'ua-parser-js', it only generates a string and has no parsing capabilities. Works with Node >=0.10.0. No releases or updates in the last 9 years.","status":"maintenance","version":"1.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/node-modules/default-user-agent","tags":["javascript","user-agent","ua","useragent","request","http"],"install":[{"cmd":"npm install default-user-agent","lang":"bash","label":"npm"},{"cmd":"yarn add default-user-agent","lang":"bash","label":"yarn"},{"cmd":"pnpm add default-user-agent","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"used to get the OS name (e.g., 'OS X Yosemite') from the platform release","package":"os-name","optional":true}],"imports":[{"note":"This package is written in CommonJS and does not provide ESM exports. If using ESM, use createRequire or dynamic import.","wrong":"import ua from 'default-user-agent';","symbol":"default","correct":"const ua = require('default-user-agent');"}],"quickstart":{"code":"const ua = require('default-user-agent');\n\n// Generate default user-agent\nconsole.log(ua()); // e.g., 'Node.js/14.17.0 (OS X 10.15; x64)'\n\n// Generate with custom app name and version\nconsole.log(ua('myapp', '1.2.3')); // 'myapp/1.2.3 Node.js/14.17.0 (OS X 10.15; x64)'","lang":"javascript","description":"Shows how to generate a User-Agent string with and without custom app name/version."},"warnings":[{"fix":"Consider using a maintained alternative like 'useragent' or manually constructing the User-Agent string.","message":"Package has no releases since 2015; issues and pull requests not addressed.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Upgrade Node.js to >=0.10.0.","message":"In Node.js versions older than 0.10.0, the package may not work due to engine requirement.","severity":"breaking","affected_versions":"<0.10.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install default-user-agent' to install it.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'default-user-agent'"},{"fix":"Use CommonJS require: const ua = require('default-user-agent');","cause":"Incorrect import pattern, e.g., using import default export in ESM project incorrectly.","error":"TypeError: ua is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}