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

dias

v1.0.0

Published

Detect PaaS details of your application instance

Downloads

70

Readme

dias NPM version Build Status Dependency Status License

Detect PaaS details of your application instance

Install

npm install dias

Supported PaaS services

  • AWS
  • AppFog
  • Nodejitsu
  • Travis CI
  • Heroku
  • Strider
  • dotCloud
  • your mac/windows/linux/freebsd box

Based on everypaas, but as of version 0.0.7, everypaas iis only functional for: Heroku, Strider, and dotCloud.

Usage

var dias = require('dias')
console.log(dias())

// additional details via callback

dias(function(data) {
  console.log(data)
})

Details available with use of callback:

  • AWS support
  • serial number
  • useragent as a collection of details in the form of a useragent

AWS example

{
  host: 'us01-dea-f8e454e6d5',
  os: 'Linux',
  serial: 'i-a5001be8',
  useragent: 'Linux/i-a5001be8 AWS/us-east-1 node/0.8.14'
  version: '3.2.0-23-virtual',
  arch: 'x64',
  gid: 114,
  uid: 22212,
  title: '/opt/cloudfoundry/runtimes/nodejs-v0.8.14/bin/node',
  node: '0.8.14',
  cpus: { model: 'Intel Xeon CPU E5-2665', cores: 2 },
  up: 10212921.312263723,
  load: [ 0.5444335935, 0.40966796875, 0.35546875 ], // 1, 5, & 15 minute load averages
  mem: { total: 17909567488, free: 352100352 }
}

AppFog example

{
  host: 'us01-dea-f8e454e6d5',
  os: 'Linux',
  serial: 'SYS-1234567890',
  useragent: 'Linux/SYS-1234567890 PaaS/AppFog node/0.8.14'
  version: '3.2.0-23-virtual',
  arch: 'x64',
  gid: 114,
  uid: 22212,
  title: '/opt/cloudfoundry/runtimes/nodejs-v0.8.14/bin/node',
  node: '0.8.14',
  cpus: { model: 'Intel Xeon CPU E5-2665', cores: 2 },
  paas: 'appfog',
  appfog: {
     id: '28af8427780e30d77d1715e64880445f',
     index: 0,
     center: 'aws'
  },
  up: 10212921.312263723,
  load: [ 0.5444335935, 0.40966796875, 0.35546875 ], // 1, 5, & 15 minute load averages
  mem: { total: 17909567488, free: 352100352 }
}

Nodejitsu example

{
   host: 'da7a889b-06ce-488b-a3b7-516648ac6868.local',
   os: 'SunOS',
   serial: 'SYS-1234567890',
   useragent: 'SunOS/SYS-1234567890 PaaS/Nodejitsu'
   version: '5.11',
   arch: 'x64',
   gid: 65534,
   uid: 103,
   node: '0.10.17',
   cpus:
   {
     model: 'Intel Xeon CPU E5645',
     cores: 24,
     speed: 2400
   },
   paas: 'nodejitsu',
   nodejitsu: 'account-subdomain',
   up: 1350401,
   load: [ 0.03125, 0.00390625, 0 ],
   mem: { total: 268435456, free: 217288704 }
}

Travis CI example

{
   host: 'testing-worker-linux-5-1-11238-linux-10',
   os: 'Linux',
   serial: 'SYS-1234567890',
   useragent: 'Linux/SYS-1234567890 PaaS/Travis node/0.10.17'
   version: '2.6.32-042stab061.2',
   arch: 'x64',
   gid: 1000,
   uid: 1000,
   title: 'node',
   node: '0.8.25',
   cpus: { cores: 32, speed: 2299 },
   paas: 'travis',
   up: 21.76509598,
   load: [ 0.208984375, 0.04736328125, 0.0146484375 ],
   mem: { total: 3221225472, free: 2842660864 }
}

Macbook example

{
  host: 'my-mac.local',
  os: 'Darwin',
  serial: 'W980000A0BM',
  useragent: 'OSX/10.8.5 SN/W980000A0BM node/0.10.33'
  version: '11.4.2',
  arch: 'x64',
  gid: 20,
  uid: 501,
  title: 'node',
  node: '0.10.33',
  cpus: { model: 'Intel Core2 Duo CPU T9800', cores: 2, speed: 2930 },
  up: 94816,
  load: [ 1.03369140625, 1.0888671875, 1.01220703125 ],
  mem: { total: 8589934592, free: 3252342784 }
}

CLI example

var dias  = require('dias')
var argv  = require('minimist')(process.argv.slice(2))

dias({uanode: argv.n}, function(platform) {
  var result = (argv.u) ? platform.useragent : JSON.stringify(platform)
  console.log(result)
})

Optional modules

serial-number module is optional to provided additional information, ex: AWS instance information. It is optional as some PaaS use have read-only file system, access '/usr/local/bin'

License: MIT

Dependencies:

everypaas