npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

user-agent-string

v1.2.0

Published

Easy way to get User Agent Strings in command line interface.

Readme

user-agent-string

Greenkeeper badge Build Status Coverage Status License Node Dependency Standard - JavaScript Style Guide

Easy way to get User Agent Strings in command line interface.

NPM

user-agent-string status

The User Agent Strings data comes from useragentstring.com

Features

  • [x] Custom User Agent Strings format and separator
  • [x] Limit the number of User Agent Strings
  • [x] User Agent Strings wraps to increase readability
  • [x] Save the User Agent Strings to a file
  • [x] List the supported browsers to select

Installation

npm install -g user-agent-string

Usage

ua-string is short for User Agent Strings

$ ua-string -h

  Usage: ua-string [options] <browser>


  Commands:

    search|find [options] <keyword>  search and select the browser to get list of User Agent Strings
    list|ls [options] [keyword]      list and select the browser to get list of User Agent Strings

  list of User Agent Strings

  Options:

    -h, --help                   output usage information
    -V, --version                output the version number
    -l, --limit <limit>          limit count of the list
    -f, --format <format>        format of the strings
    -s, --separator <separator>  separators of the strings
    --line                       each string has a newline
    --save <file>                save to file

-l, --limit <limit>

Limit the number of User Agent Strings.

-l 1 limit is 1, -l 10 limit is 10, etc. Examples can be found in the following.

-f, --format <format>

Customize the string format, depending on your needs.

The rule is to use * to replace %s, you can also use %s, e.g. -f '<%s>', -f '{(%s)}', very simple, default format is "*", same as -f '"*"', e.g.

$ ua-string Chrome -l 1 # default
# >>> "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"

$ ua-string Chrome -l 1 -f '<*>'
# >>> <Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36>

$ ua-string Chrome -l 1 -f '{(*)}'
# >>> {(Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36)}

-s, --separator <separator>

Customize the string separator, depending on your needs.

The rule also very simple, default separator is , , e.g.

$ ua-string Dillo -l 5 # default
# >>> "Dillo/2.0", "Dillo/0.8.6-i18n-misc", "Dillo/0.8.6", "Dillo/0.8.5-i18n-misc", "Dillo/0.8.5"

$ ua-string Dillo -l 5 -s ' | '
# >>> "Dillo/2.0" | "Dillo/0.8.6-i18n-misc" | "Dillo/0.8.6" | "Dillo/0.8.5-i18n-misc" | "Dillo/0.8.5"

$ ua-string Dillo -l 5 -s '&'
# >>> "Dillo/2.0"&"Dillo/0.8.6-i18n-misc"&"Dillo/0.8.6"&"Dillo/0.8.5-i18n-misc"&"Dillo/0.8.5"

--line

User Agent Strings wraps to increase readability.

Not use --line:

$ ua-string Dillo -l 3
# >>> "Dillo/2.0", "Dillo/0.8.6-i18n-misc", "Dillo/0.8.6"

Use --line:

$ ua-string Dillo -l 3 --line
# >>> "Dillo/2.0", 
      "Dillo/0.8.6-i18n-misc", 
      "Dillo/0.8.6"

--save <file>

Save the User Agent Strings to a file, e.g.

$ ua-string Chrome -l 5 --save user_agent
.
├── user_agent

Automatically create the directory.

$ ua-string Chrome -l 5 --save ./ua/user_agent
.
├── ua
│   ├── user_agent

With --line can increase content readability.

$ ua-string Chrome -l 5 --line --save ~/user_agent

search | find [options] <search>

Search and select browser to get list of User Agent Strings. e.g.

$ ua-string search ch -l 1 --line

$ ua-string search chrome -l 5 --save user_agent

list | ls [options] [keyword]

List and select browser to get list of User Agent Strings. e.g.

$ ua-string list -l 5

$ ua-string list -l 5 --line

Similar to search|find, e.g.

$ ua-string list ch -l 1 --line

$ ua-string list chrome -l 5 --save user_agent

License

The MIT License