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

@evan-abc/typescript-helpers

v0.3.5

Published

helper functions & extension methods for typescript

Readme

Typescript Helpers v0.3.5

Provides helper functions and extension methods for Typescript

Installation:

In npm:

$ npm i @evan-abc/typescript-helpers --save-dev

In yarn:

$ yarn add -D @evan-abc/typescript-helpers

Extension Methods

Array

First:

Gets the first element in the array. Returns undefined if it is not found.

const arr = [1,2,3]
arr.first() // 1

Last:

Gets the last element in the array. Returns undefined if it is not found.

const arr = [1,2,3]
arr.last() // 3

Boolean

Switches a true boolean to false and a false boolean to true.

Not:

const bool = true
bool.not() // false

Number

Seconds:

Converts numbers representing seconds into milliseconds.

const num  = 5
num.seconds() // 5000

Object

Matches:

Checks that two object match. This extension method has a optional flag argument to check if the two object match when stringified (i.e. that the contents of the two objects matches). It defaults to true

const obj1 = { first: 1, last: 2 }
const obj2 = { first: 1, last: 2 }
obj1.matches(obj2) // true
obj1.matches(obj2, false) // false

String

Capitalize:

Capitalizes the first letter of a string.

const str = "hello world"
str.capitalize() // "Hello world"

Truncate:

Truncates the string to the size specified

const str = "hello world
str.truncate(3) // "Hel..."

Helpers

Wait:

Used to wait a given amount of milliseconds. Default time is 2000ms.

wait(5000) // waits for 5 seconds

Assert:

Throws given error if predicate is not true.

const predicate = false
const error = new Error("Something is wrong!")

assert(predicate, error) // throws error "Something is wrong!"