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

smart-info

v1.0.1

Published

Show information and metric about node proccess, machine and application

Downloads

1

Readme

Smart Info

This lib provides json information about node process, application and system.

Install

npm i smart-info --save

Use

To get complete information just send true to info method.

var smartInfo = require('smart-info');
var info = smartInfo.info(true);

To get minimum information just send false to info method.

var smartInfo = require('smart-info');
var info = smartInfo.info(false);

Use inside application route

You can use smart-info inside your application route and protect restrict information using "completeInformation" parameter of info method.

app.get('/hc/:secret?', (req, res, next) => {

    const smartInfo = require('smart-info');

    // show complete info only if route secret is ok
    var completeInfo = req.params.secret === 'my-secret-for-the-route';
    var info = smartInfo.info(completeInfo);

    res.status(200).send(info);
});

Result example

{
   "package":{
      "name":"api",
      "description":"My application",
      "version":"1.0.0",
      "homepage":"-",
      "author":"Diogo Leitão Menezes",
      "bugs":"-",
      "repository":"-",
      "license":"ISC"
   },
   "process":{
      "uptime":"6.036 seconds",
      "memory":{
         "rss":36,
         "heapUsed":9,
         "heapTotal":12,
         "external":0
      },
      "detail":{
         "version":"7.6.0",
         "user":"dmenezes",
         "lang":"pt_BR.UTF-8",
         "arch":"x64",
         "platform":"linux",
         "pid":24723,
         "cwd":"/home/dmenezes/projetos/my-api",
         "versions":{
            "http_parser":"2.7.0",
            "node":"7.6.0",
            "v8":"5.5.372.40",
            "uv":"1.11.0",
            "zlib":"1.2.11",
            "ares":"1.10.1-DEV",
            "modules":"51",
            "openssl":"1.0.2k",
            "icu":"58.2",
            "unicode":"9.0",
            "cldr":"30.0.3",
            "tz":"2016j"
         },
         "env":{
            "LESSOPEN":"| /usr/bin/lesspipe %s",
            "GNOME_KEYRING_PID":"",
            "USER":"dmenezes",
            "LANGUAGE":"pt_BR:pt:en"            
         },
         "config":{
            "variables":{
               "asan":0,
               "coverage":false,
               "debug_devtools":"node",
               "force_dynamic_crt":0,
               "gas_version":"2.23",
               "host_arch":"x64",
               "icu_data_file":"icudt58l.dat",
               "icu_data_in":"../../deps/icu-small/source/data/in/icudt58l.dat",
               "icu_endianness":"l",
               "icu_gyp_path":"tools/icu/icu-generic.gyp",
               "icu_locales":"en,root",
               "icu_path":"deps/icu-small",
               "icu_small":true,
               "icu_ver_major":"58",
               "node_byteorder":"little",
               "node_enable_d8":false,
               "node_enable_v8_vtunejit":false,
               "node_install_npm":true,
               "node_module_version":51,
               "node_no_browser_globals":false,
               "node_prefix":"/",
               "node_release_urlbase":"https://nodejs.org/download/release/",
               "node_shared":false,
               "node_shared_cares":false,
               "node_shared_http_parser":false,
               "node_shared_libuv":false,
               "node_shared_openssl":false,
               "node_shared_zlib":false,
               "node_tag":"",
               "node_use_bundled_v8":true,
               "node_use_dtrace":false,
               "node_use_etw":false,
               "node_use_lttng":false,
               "node_use_openssl":true,
               "node_use_perfctr":false,
               "node_use_v8_platform":true,
               "openssl_fips":"",
               "openssl_no_asm":0,
               "shlib_suffix":"so.51",
               "target_arch":"x64",
               "uv_parent_path":"/deps/uv/",
               "uv_use_dtrace":false,
               "v8_enable_gdbjit":0,
               "v8_enable_i18n_support":1,
               "v8_inspector":true,
               "v8_no_strict_aliasing":1,
               "v8_optimized_debug":0,
               "v8_random_seed":0,
               "v8_use_snapshot":true,
               "want_separate_host_toolset":0,
               "want_separate_host_toolset_mkpeephole":0
            }
         }
      }
   },
   "os":{
      "totalmem":8,
      "freemem":2,
      "core":4,
      "model":"Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz",
      "speed":2432,
      "hostname":"agility"
   },
   "message":"Ok, API is running."
}