Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodejs-info

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodejs-info

Node info on package, os, process memory, timezone, versions, environment, request

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
decreased by-73.65%
Maintainers
1
Weekly downloads
 
Created
Source

NodeInfo

Outputs information about Node.js configuration, somewhat comparably to PHP’s phpinfo().

Includes information about the npm package, operating system, process memory, versions of Node and Node components, the request, and the headers.

The nodeinfo() function returns an HTML page as a string, which can be rendered through any tool: Connect, Express, Koa, etc.

Example usage (Node)

const http     = require('http');
const nodeinfo = require('nodejs-info');

const server = http.createServer((req, res) => {
    res.writeHead(200, { "Content-Type": "text/html" });
    res.end(nodeinfo(req));
});

server.listen(3000, () => console.log('Listening on port 3000'));

Example usage (Express)

const express  = require('express');
const nodeinfo = require('nodejs-info');

const app = express();

app.get('/', (req, res) => {
    res.send(nodeinfo(req));
});

app.listen(3000, () => console.log('Listening on port 3000'));

Example usage (Koa)

const Koa      = require('koa');
const nodeinfo = require('nodejs-info');

const app = new Koa();

app.use(ctx => {
    ctx.body = nodeinfo(ctx.req);
});

app.listen(3000, () => console.log('Listening on port 3000'));

CSS styling can be provided via the optional style parameter.

const html = nodeinfo(req, { style: 'table { background-color: #cccccc }' }); 

Screenshot

Requires Node.js v4.0+.

Keywords

FAQs

Package last updated on 14 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc