@shanzhai/stringify-json-output
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

@shanzhai/stringify-json-output Continuous Integration License FOSSA Status Renovate enabled npm npm type definitions

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:

new CopyStep(
  `Example`,
  new ConstantInput([1, 2, 3]),
  new StringifyJsonOutput(new ExampleOutput())
);
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

Readme

Keywords

none

Package Sidebar

Install

npm i @shanzhai/stringify-json-output

Weekly Downloads

0

Version

0.0.8

License

MIT

Unpacked Size

5.84 kB

Total Files

5

Last publish

Collaborators

  • jameswilddev