Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@digitak/cute

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitak/cute

A tool library to stringify and output values to the console

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cute

A Typescript tool library to stringify and output values to the console.

It can be used as an alternative to Node's util.inspect or JSON.stringify.

This library is quite similar to stringify-object but it also handles:

  • big integers,
  • console colors.

It has no dependencies and can work in any environment.

Stringify API

export function stringify(
  value: unknown,
  options?: Partial<StringifyOptions>
): string

export type StringifyOptions = {
  // allowed characters before line break
  maxCharacters: number = 24
  // indentation characters
  indent: string = '  '
  // start level of indentation
  level: number = 0
  // whether to use ASCII colors or not
  colors: boolean = false
  // allow to customize the color theme
  theme: Record<ThemeToken, string>
}

Usage

import { stringify } from "@digitak/cute"

console.log(stringify({ foo: 12, bar: "12" }))

console.log(stringify({ foo: 12, bar: "12" }, {
  indentation: '\t',
  colors: true,
}))

Colors API

This library also export ASCII colors.

You can import them separately or under a namespace.

import { red, blue, brightCyan } from "@digitak/cute/colors"
// or
import * as colors from "@digitak/cute/colors"

FAQs

Package last updated on 10 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc