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 🙏

© 2024 – Pkg Stats / Ryan Hefner

xrandr-verbose-parse

v1.1.1

Published

Parse the output of the `xrandr --verbose` command

Downloads

12

Readme

xrandr-verbose-parse

parse the output of the xrandr --verbose command

This module was based on substack's xrandr parser

example

var parse = require('xrandr-verbose-parse');
var exec = require('child_process').exec;

exec('xrandr --verbose', function (err, stdout) {
    var query = parse(stdout);
    console.log(JSON.stringify(query, null, 2));
});

the xrandr --verbose command produced this output:

Screen 0: minimum 320 x 200, current 1080 x 1920, maximum 2048 x 2048
HDMI-1 connected 1080x1920+0+0 (0x44) right (normal left inverted right x axis y axis) 477mm x 268mm
	Identifier: 0x42
	Timestamp:  96798461
	Subpixel:   unknown
	Gamma:      1.0:1.0:1.0
	Brightness: 1.0
	Clones:    
	CRTC:       2
	CRTCs:      2
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	EDID: 
		00ffffffffffff001e6dd75801010101
		0115010380301b78ea9535a159579f27
		0e5054a54b00714f8180818fb3000101
		010101010101023a801871382d40582c
		4500dd0c1100001e000000fd00384b1e
		530f000a202020202020000000fc0049
		50533232340a202020202020000000ff
		000a2020202020202020202020200189
		02031df14a900403011412051f101323
		0907078301000065030c001000023a80
		1871382d40582c4500dd0c1100001e01
		1d8018711c1620582c2500dd0c110000
		9e011d007251d01e206e285500dd0c11
		00001e8c0ad08a20e02d10103e9600dd
		0c110000180000000000000000000000
		000000000000000000000000000000c2
  1920x1080 (0x44) 148.500MHz +HSync +VSync *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1920x1080 (0x45) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz

and the parsed result is:

{
  "HDMI-1": {
    "connected": true,
    "orientation": "normal",
    "modes": [{
        "name": "1920x1080",
        "width": "1920",
        "height": "1080",
        "rate": 148.5,
        "optionals": "+HSync +VSync ",
        "current": true,
        "preferred": true,
        "dimensions": {
            "vertical": {
                "width": "1080",
                "start": "1084",
                "end": "1089",
                "total": "1125",
                "clock": 60
            },
            "horizontal": {
                "width": "1920",
                "start": "2008",
                "end": "2052",
                "total": "2200",
                "skew": "0",
                "clock": 67.5
            }
        }
    }],
    "index": 0,
    "width": 1920,
    "height": 1080,
    "left": 0,
    "top": 0
   }
}

methods

var parse = require('xrandr-verbose-parse')

parse(xrandrOutput)

Return the parsed output from a string full of the output from xrandr, xrandrOutput.

The return object is keyed by each output name.

install

With npm do:

npm install xrandr-verbose-parse

license

MIT