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

@igleite/tsutils

v1.0.8

Published

Uma coleção de utilitários em TypeScript para facilitar o desenvolvimento no dia a dia.

Readme

TSUtils

TSUtils – Uma coleção de utilitários em TypeScript para facilitar o desenvolvimento no dia a dia.

Instalação

Para instalar o pacote, utilize o seguinte comando:

npm i @igleite/tsutils

Exemplos

Importe as classes no seu projeto:

import { StringUtils, TimeUtils } from '@igleite/tsutils';

Utilize os métodos conforme necessário em seu código.


// Exemplo de uso de ArrayUtils (FlatMap)
const nestedArray = [1, [2, [3, 4]], 5];
const flatArray = ArrayUtils.flatMap(nestedArray);
console.log(flatArray); // Saída: [1, 2, 3, 4, 5]

// Exemplo de uso de Base64Url
const encoded = Base64Url.encode('Hello, World!');
console.log(encoded); // Saída: SGVsbG8sIFdvcmxkIQ

// Exemplo de formatação de CEP usando BrazilFormatUtils
console.log(BrazilFormatUtils.formatarCep('12345678')); // Retorna '12345-678'
console.log(BrazilFormatUtils.formatarCep(12345678)); // Retorna '12345-678'

// Exemplo de uso de CurrencyUtils para conversão de valores monetários
const decimal1 = CurrencyUtils.ToDecimal("1.234,56"); // Retorna 1234.56
const decimal2 = CurrencyUtils.ToDecimal("100,00");   // Retorna 100.00
const decimal3 = CurrencyUtils.ToDecimal(null);       // Retorna 0

// Exemplo de conversão de Data UTC para horário local usando DateUtils
const utcDate = new Date('2023-09-21T10:00:00Z');
const localDate = DateUtils.convertUTCDateToLocalDate(utcDate);
console.log(localDate); // Exibe a data convertida para o horário local

// Exemplo de verificação de campos vazios com FieldUtils
console.log(FieldUtils.hasEmptyFields(null, '', 'Hello')); // true
console.log(FieldUtils.hasEmptyFields(['Hello', 'World', ''])); // true
console.log(FieldUtils.hasEmptyFields(['Hello', 'World'], ['Test', 'Example'])); // false

// Exemplo de uso de StringUtils para verificar se uma string está vazia
console.log(StringUtils.isNullOrEmpty(null));      // true
console.log(StringUtils.isNullOrEmpty(''));        // true
console.log(StringUtils.isNullOrEmpty('test'));    // false
console.log(StringUtils.isNullOrEmpty(undefined)); // true

// Exemplo de conversão de segundos para o formato HH:mm:ss com TimeUtils
console.log(TimeUtils.converterSegundosParaHHMMSS(3665)); // Retorna "01:01:05"

Contribuições

Sinta-se à vontade para abrir issues ou enviar pull requests caso deseje contribuir com melhorias ou correções.