# @shanzhai/stringify-json-output

> A Shanzhai output which "stringifies" a value before passing it to an output.

Latest version **0.0.8** (published 2022-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shanzhai/stringify-json-output
pnpm add @shanzhai/stringify-json-output
yarn add @shanzhai/stringify-json-output
bun add @shanzhai/stringify-json-output
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2022-04-15 |
| First published | 2021-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=17.6.0 |
| Dependencies | 1 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | jameswilddev |

## Links

- npm: https://www.npmjs.com/package/@shanzhai/stringify-json-output
- Repository: https://github.com/jameswilddev/shanzhai
- Homepage: https://github.com/jameswilddev/shanzhai#readme
- Issues: https://github.com/jameswilddev/shanzhai/issues
- npm.io page: https://npm.io/package/@shanzhai/stringify-json-output

## Dependencies (1)

- [@shanzhai/interfaces](https://npm.io/package/@shanzhai/interfaces.md) 0.0.26

## Recent versions

- 0.0.8 (latest) — 2022-04-15
- 0.0.7 — 2022-04-10
- 0.0.6 — 2022-03-31
- 0.0.5 — 2022-03-29
- 0.0.4 — 2021-09-11
- 0.0.3 — 2021-08-30
- 0.0.2 — 2021-08-22
- 0.0.1 — 2021-08-15
- 0.0.0 — 2021-08-14

## README

# `@shanzhai/stringify-json-output` [![Continuous Integration](https://github.com/jameswilddev/shanzhai/workflows/Continuous%20Integration/badge.svg)](https://github.com/jameswilddev/shanzhai/actions) [![License](https://img.shields.io/github/license/jameswilddev/shanzhai.svg)](https://github.com/jameswilddev/shanzhai/blob/master/license) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjameswilddev%2Fshanzhai.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjameswilddev%2Fshanzhai?ref=badge_shield) [![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/) [![npm](https://img.shields.io/npm/v/@shanzhai/stringify-json-output.svg)](https://www.npmjs.com/package/@shanzhai/stringify-json-output) [![npm type definitions](https://img.shields.io/npm/types/@shanzhai/stringify-json-output.svg)](https://www.npmjs.com/package/@shanzhai/stringify-json-output)

A Shanzhai output which "stringifies" a value before passing it to an output.

## Usage

Give an instance of `StringifyJsonOutput` to a `Step` as an output and it will
convert the value it is given into a string of JSON before passing it to its
nested `Output`.

For example, the following examples are equivalent:

```typescript
new CopyStep(
  `Example`,
  new ConstantInput([1, 2, 3]),
  new StringifyJsonOutput(new ExampleOutput())
);
```

```typescript
new CopyStep(
  `Example`,
  new ConstantInput(`[1,2,3]`),
  new ExampleOutput()
);
```

Note that this does not directly use `JSON.stringify`; it has the following
differences:

- Object key order is always sorted, ascending.
- Object properties with undefined values are omitted from the string of JSON.

## Dependencies

This package has no runtime dependencies.

## Peer Dependencies

This package has no runtime peer dependencies (it does not expect any other packages to be installed alongside itself).

## License

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjameswilddev%2Fshanzhai.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjameswilddev%2Fshanzhai?ref=badge_large)

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