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

@dash4/log

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dash4/log

dash4 log helper

  • 0.9.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-18.42%
Maintainers
1
Weekly downloads
 
Created
Source

Dash4 log

pretty log for dash4

NPM version License Commitizen friendly Prettier TypeScript-ready


The following documentation is just relevant for dash4 plugin development. For informations on how to use Dash4 please read this: Dash4 documentation

Table of Contents

Installation

npm i -D @dash4/log

Usage

server-side

Dash4 server logger

import { log, info, success, error, warn, spinner } from '@dash4/log';

log('terminal', 'place text here');
info('readme', 'place text here');
success('npm-scripts', 'place text here');
error('dependencies', 'place text here');
warn('ui', 'place text here');

const spin = spinner('terminal', 'load config');
spin.start();
await wait(1000);
spin.type('warn');
spin.text('needs longer than usual');
await wait(1000);
spin.succeed('config loaded');

types

type TPackageName = 'server' | 'terminal-emulator' | 'cli' | string;
type TMessage = string | number | object | any[];
type TType = 'log' | 'info' | 'success' | 'error' | 'warn';

export const log = (packageName: TPackageName, message: TMessage) => void;
export const info = (packageName: TPackageName, message: TMessage) => void;
export const success = (packageName: TPackageName, message: TMessage) => void;
export const error = (packageName: TPackageName, message: TMessage) => void;
export const warn = (packageName: TPackageName, message: TMessage) => void;

export function spinner(packageName: TPackageName, message: TMessage, type?: TType): {
  start(): void;
  succeed(_message: string): void;
  fail(_message: string): void;
  warn(_message: string): void;
  info(_message: string): void;
  text(_message: string): void;
  type(_message: string): void;
  stop(): void;
  stopAndPersist(): void;
  clear: (): void;
  isSpinning: boolean;
  indent: number;
}

client-side

Dash4 client logger

import { log, info, success, error, warn } from '@dash4/log/build/browser';

log('terminal', 'place some text here');
info('readme', 'place some text here');
success('npm-scripts', 'place some text here');
error('dependencies', 'place some text here');
warn('ui', 'place some text here');

types

export type TPackageName = 'client' | 'react-xterm' | 'ui' | string;
export type TMessage = string | number | object | any[];

export const log = (packageName: TPackageName, message: TMessage, ...args: TMessage[]) => void;
export const info = (packageName: TPackageName, message: TMessage, ...args: TMessage[]) => void;
export const success = (packageName: TPackageName, message: TMessage, ...args: TMessage[]) => void;
export const error = (packageName: TPackageName, message: TMessage, ...args: TMessage[]) => void;
export const warn = (packageName: TPackageName, message: TMessage, ...args: TMessage[]) => void;

License

The @dash4/log is MIT licensed

FAQs

Package last updated on 07 Dec 2020

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