@jsonhero/json-infer-types-formatter
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

JSON Infer Types Formatter

You can nicely format values, with inferred or explicitly specified types (using the @jsonhero/json.infer-types package).

Installation

$ npm install --save @jsonhero/json-infer-types-formatter

Getting started

JavaScript:

const { format } = require("@jsonhero/json-infer-types-formatted");

TypeScript:

import { format } from "@jsonhero/json-infer-types-formatted";
format(1234.567); // => { simple: "1,234.567", html: "1,234.567" }
format(true); // =>  { simple: "True", html: "True" }
format(null); // =>  { simple: "Null", html: "Null" }
format([0, 1]); // =>  { simple: "[0,1]", html: "<code>[0,1]</code>" }
format({ name: "Matt" }); // =>  { simple: '{"name":"Matt"}', html: '<code>{"name":"Matt"}</code>' }
format("https://www.google.com"); // => { simple: "https://www.google.com", html: '<a href="https://www.google.com">https://www.google.com</a>' }

Readme

Keywords

none

Package Sidebar

Install

npm i @jsonhero/json-infer-types-formatter

Weekly Downloads

3

Version

0.0.6

License

MIT

Unpacked Size

15.3 kB

Total Files

6

Last publish

Collaborators

  • ericallam
  • mattaitken