@blackglory/log
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

log

Install

npm install --save @blackglory/log
# or
yarn add @blackglory/log

Usage

import { log } from '@blackglory/log'

const value = log('foo', 'bar')
// Equivalent to
const value = (console.log('foo', 'bar'), 'bar')

API

log

function log<T>(...data: [...any[], T]): T

time

function time<T>(message: string, fn: () => T): T
function time<T>(message: string, fn: () => PromiseLike<T>): Promise<T>

timeFunction

function timeFunction<Result, Args extends any[]>(
  message: string
, fn: (...args: Args) => Result
): (...args: Args) => Result

timeAsyncFunction

function timeAsyncFunction<Result, Args extends any[]>(
  message: string
, fn: (...args: Args) => PromiseLike<Result>
): (...args: Args) => Promise<Result>

group

function group<T>(label: string, fn: () => T): T
function group<T>(fn: () => T): T

Readme

Keywords

none

Package Sidebar

Install

npm i @blackglory/log

Weekly Downloads

316

Version

2.0.2

License

MIT

Unpacked Size

13.5 kB

Total Files

31

Last publish

Collaborators

  • black_glory