npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dattx328-ts-helpers

v1.0.9

Published

Using npm:

Readme

Installing

Using npm:

$ npm i dattx328-ts-helpers

Example

import { copyToClipboard, isDateValid } from 'dattx328-ts-helpers';

copyToClipboard('Text to clipboard');

isDateValid('2020 03 20');

Func

| Func | Description | Parameter | Return | | ------ | ------ | ------ | ------ | | copyToClipboard | Copy to Clipboard | text: string | | | isDateValid | Check if Date is Valid | date: string | true/false | | dayOfYear | Find the day of the year | date: string | date | | getLastDayOfMonth | Return last instance of week day for given year and month | year: number, month: number, day: string | date | | timeFromDate | Log Time from Date | date: Date | time | | capitalize | Capitalize a String | str: string | string | | dayDif | Find the number of days between two days | start: any, end: any | number | | clearCookies | Clear All Cookies | | | | randomHex | Generate Random Hex | | hex | | removeDuplicates | Remove Duplicated from Array | arr: any[] | array | | getQueryParams | Get Query Params from URL | url: string | string | | arrayToCSV | This snippet converts the elements that don’t have commas or double quotes to strings with comma-separated values. | arr: any[], delimiter: string = ',' | arr | | average | This snippet returns the average of two or more numerical values. | ...nums: number[] | num | | bottomVisible | This snippet checks whether the bottom of a page is visible. | | true/false | | differenceTwoArrays | This snippet finds the difference between two arrays. | a: any[], b: any[] | array | | getStyle | This snippet can be used to get the value of a CSS rule for a particular element. | el: any, ruleName: string | styles | | hasClass | This snippet checks whether an element has a particular class. | el: any, className: string | boolean | | insertAfter | This snippet can be used to insert an HTML string after the end of a particular element. | el: any, htmlString: string | | | insertBefore | This snippet can be used to insert an HTML string before a particular element. | el: any, htmlString: string | | | isBrowser | This snippet can be used to determine whether the current runtime environment is a browser. | | boolean | | isBrowserTabFocused | This snippet can be used to determine whether the browser tab is focused. | | boolean | | randomIntArrayInRange | This snippet can be used to generate an array with n random integers in a specified range. | min: number, max: number, n: number = 1 | array | | randomIntegerInRange | This snippet can be used to generate a random integer in a specified range. | min: number, max: number | number(integer) | | randomNumberInRange | This snippet can be used to return a random number in a specified range. | min: number, max: number | number | | redirectTo | This snippet can be used to do a redirect to a specified URL. | url: string, asLink: boolean = true | | | reverseString | This snippet can be used to reverse a string. | str: any | hex | | sortArray | Sort array by key | arr: any[], key: string, orderBy: string = 'asc' | array | | scrollToTop | Smooth-scroll to the top of the page | | | | createTimer | Create a countdown timer | start: string, end: string | object | | isMobile | Check is mobile | | boolean | | validateEmail | Validate email address | email: string | boolean | | removeNonASCII | Remove characters that are not ASCII | str: string | string | | slugify | Slug characters | text: string | string | | generateVariants | Generate variants | attributes: any = {colors: [], sizes: []} | array | | forceDownloadFile | Download file | url: string | | | copyToClipboardV2 | Copy to clipboard with text area | text: string | | | formatNumber | Format number | num: any, format: string = 'en-US' | string | | formatVideoTime | Format video time | seconds: any | string | | formatFileSize | Format file size | size: any | string |