Socket
Socket
Sign inDemoInstall

node-inspect-extracted

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-inspect-extracted

Node's util.inspect, extracted for use on the Web


Version published
Weekly downloads
31K
decreased by-10.12%
Maintainers
1
Weekly downloads
 
Created
Source

node-inspect-extracted

This library provides an as-faithful-as-possible implementation of Node.js's util.inspect function.

It was built in such a way that it can be kept up-to-date with node's implementation, by taking the code directly from node's repo, and changing nothing but the require() statements. All of the node built-in functions are emulated. Many of the incompatibilities generated from that emulation are not interesting for Web use cases.

Installation

npm install node-inspect-extracted

Use

This should work in node (for testing) and browsers, using either require, import, or as window.Inspect if you include this in your page as a script tag.

With require:

const { inspect } = require('node-inspect-extracted');
console.log(inspect(1));

With import:

import * as inspect from 'node-inspect-extracted';
console.log(inspect.inspect(2));

From the browser:

<script src="https://unpkg.com/node-inspect-extracted/dist/inspect.js"></script>
<script>
  console.log(Inspect.inspect(3));
</script>

LICENSE

This code is an adaptation of the Node.js internal implementation, mostly from the file lib/internal/util/inspect.js, which does not have the Joyent copyright header. The maintainers of this package will not assert copyright over this code, but will assign ownership to the Node.js contributors, with the same license as specified in the Node.js codebase; the portion adapted here should all be plain MIT license.

Tests Coverage Status

Keywords

FAQs

Package last updated on 05 Feb 2021

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