xbrief

1.0.5 • Public • Published

xbrief

npm version npm download monthly npm download total npm dependents npm license pp install size github commit last github commit total

A stringify tool to javascript object

Features

  • A substitute for JSON.stringify
  • ES2015 syntax

Install

$ npm install xbrief

Usage

import { deco } from 'xbrief'

const objects = {
  boolean: true,
  string: 'Shakespeare',
  number: 128,
  null: null,
  undefined: undefined,
  one_row_matrix: [ [1, 1, 2, 3, 5, 8, 13, 21] ],
  simple_set: new Set([1, 1, 1, 2, 2, 3, 3, 3]),
  simple_matrix: Array.from({ length: 3 }, (_, x) =>
    Array.from({ length: 8 }, (_, y) => x + y + 1)),
  simple_map: new Map([['Lagos', 861], ['Dhaka', 8906], ['Lima', 9174], ['Ankara', 5271], ['Nagpur', 2405]]),
  simple_lambda: (x) => `${x}`,
}

console.log(deco(objects))

License

MIT

Copyright (y) 2019-present, Haoyang (Vincent) Wang

Readme

Keywords

Package Sidebar

Install

npm i xbrief

Weekly Downloads

108

Version

1.0.5

License

MIT

Unpacked Size

48.3 kB

Total Files

5

Last publish

Collaborators

  • hoyeung