# @jsenv/inspect

> Convert a value into a readable string

Latest version **2.0.0** (published 2024-01-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jsenv/inspect
pnpm add @jsenv/inspect
yarn add @jsenv/inspect
bun add @jsenv/inspect
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2024-01-12 |
| First published | 2019-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=14.7.0 |
| Dependencies | 0 |
| Unpacked size | 60 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Maintainers | jsenv-admin, dmail |

## Links

- npm: https://www.npmjs.com/package/@jsenv/inspect
- Repository: https://github.com/jsenv/core
- Homepage: https://github.com/jsenv/core#readme
- Issues: https://github.com/jsenv/core/issues
- npm.io page: https://npm.io/package/@jsenv/inspect

## Recent versions

- 2.0.0 (latest) — 2024-01-12
- 1.9.1 — 2023-11-20
- 1.9.0 — 2023-10-02
- 1.8.0 — 2023-09-26
- 1.7.3 — 2023-01-23
- 1.7.2 — 2022-10-17
- 1.7.1 — 2022-04-02
- 1.7.0 — 2022-04-02
- 1.6.0 — 2021-08-12
- 1.5.0 — 2021-02-22
- 1.4.1 — 2021-02-17
- 1.3.1 — 2020-02-28
- 1.3.0 — 2020-02-26
- 1.2.2 — 2020-01-21
- 1.2.1 — 2020-01-14
- … 4 more at https://npm.io/package/@jsenv/inspect/versions

## README

# inspect [![npm package](https://img.shields.io/npm/v/@jsenv/inspect.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/inspect)

`@jsenv/inspect` turns a JavaScript value into a string meant to be read by a human. It is written in ES6 and compatible with browsers and Node.js.

```js
import { inspect } from "@jsenv/inspect";

console.log(
  inspect({
    boolean: true,
    number: 10,
    string: "hello world",
  }),
);
```

```console
❯ node ./docs/demo.mjs
{
  "boolean": true,
  "number": 10,
  "string": "hello world"
}
```

# Comparison with JSON.stringify

Table comparing `JSON.stringify` and `@jsenv/inspect` to demonstrates how inspect focuses on readability and accuracy.

| value     | JSON.stringify | jsenv inspect |
| --------- | -------------- | ------------- |
| 123456789 | "123456789"    | 123_456_789   |
| Infinity  | "null"         | Infinity      |
| -0        | "0"            | -0            |
| '"'       | '"\\""'        | '"'           |

---
_Source: https://npm.io/package/@jsenv/inspect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
