パッケージの詳細

@blackglory/log

BlackGlory5kMIT2.0.2

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

readme

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

更新履歴

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.0.2 (2023-06-11)

Bug Fixes

2.0.1 (2023-03-18)

2.0.0 (2023-01-27)

⚠ BREAKING CHANGES

    • CommonJS => ESM.
  • The minimal version of Node.js is 16.

  • commonjs => esm (73c71ce)

1.3.4 (2023-01-27)

1.3.3 (2022-11-01)

1.3.2 (2022-11-01)

1.3.1 (2022-10-31)

1.3.0 (2022-10-11)

Features

1.2.0 (2022-04-19)

Features

  • improve timestmap resolution (4070bc7)

1.1.1 (2022-04-18)

Bug Fixes

1.1.0 (2022-04-18)

Features

  • add timeFuntion, timeAsyncFunction (172b0ba)

1.0.0 (2022-03-05)

0.1.1 (2022-02-28)

Features

0.1.0 (2021-12-28)

Features