1.6.0 • Published 8 months ago

briznads-helpers v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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. Individual functions are exported as ES modules, so your preferred bundler should do the tree shaking thing and keep the bundle size nice and small.

documentation

There isn't any, at least, not yet. That said, all functions are written in typescript and I endeavor to eschew cleverness in my code in favor of legibility. Therefore, the code should be somewhat self-documenting; it should be possible to view the individual functions and discern what the expected input and output types/patterns are. How laughably naive and/or unrealistic that last statement is, I'll leave for you to assess.

*dependencies

The helper functions are mostly dependency-free. The 1 exception is the createId function, which relies upon nanoid to generate random IDs of varying lengths and character styles.

1.6.0

8 months ago

1.2.0

12 months ago

1.1.0

12 months ago

1.5.1

11 months ago

1.4.0

12 months ago

1.2.1

12 months ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.6

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago