Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

briznads-helpers

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

briznads-helpers

Generic, zero-dependency helper functions and types for use in disparate typescript projects.

latest
Source
npmnpm
Version
2.3.0
Version published
Maintainers
1
Created
Source

briznads-helpers

Generic, zero-dependency helper functions and types for use in disparate typescript projects.

install

npm install briznads-helpers --save

use

import { sleep, ago } from 'briznads-helpers';

…

const date : Date = new Date();

async function printString() : void {
	await sleep(2500);

	console.log(`the "date" variable was created ${ ago(date) }`);
}

printString();

background

This package brings together a number of helpful types and functions that I've found myself reaching for time and again. The package exports compiled JavaScript as native ESM modules with TypeScript type declarations, compatible with modern bundlers and supporting tree-shaking.

documentation

Each helper has its own README with usage examples and argument reference.

ExportDescription
agoFormat a past date as "X ago".
deepCopyJSON-based deep clone.
flattenEdgeNodeArrayFlatten a GraphQL edges/nodes connection.
getSafe nested property access by path.
getDateStringDate → toString(), '' if invalid.
getTimeStringDate → toLocaleTimeString(), '' if invalid.
isEmpty, isEmptyItem, removeEmptyItemsEmptiness checks sharing EmptyOpts.
isInvalidDateTest for missing or Invalid Date.
isListPopulatedTest for non-empty array.
isNullishTest for null or undefined.
lapsedFormat a millisecond duration as human text.
listifyEnsure a value is an array.
objectEntries, objectKeys, objectValuesType-preserving Object.* wrappers.
parseDateNormalize a date-like input to Date.
QueryRegex-based filtering of lists and object arrays.
roundToDecimalsRound a number to N decimal places.
sleepAsync delay for N milliseconds.
smartSort, smartSortFunctionSort with sensible defaults; comparator exposed.
sortNumericallyAscending numeric sort.
uniqueArray, uniqueFilterDeduplicate an array; filter callback exposed.

FAQs

Package last updated on 24 Apr 2026

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