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

@zadytach/core

v1.0.3

Published

Uma coleção de funções utilitárias simples e leves para tarefas comuns em projetos.

Readme

BlackMagic-Core

NPM Version License: MIT

Uma coleção de funções utilitárias simples, leves e eficientes para tarefas comuns em projetos JavaScript/TypeScript.

📦 Instalação

npm install @zadytach/core

ou com yarn:

yarn add @zadytach/core

ou com pnpm:

pnpm add @zadytach/core

🚀 Uso Rápido

import {
  isEmail,
  isUrl,
  isDefined,
  equalsIgnoreCase,
  sleep,
  formatBytes,
  msToTime,
} from "@zadytach/core";

// Validação
isEmail("[email protected]"); // true
isUrl("https://example.com"); // true
isDefined(null); // false

// String
equalsIgnoreCase("Hello", "hello"); // true

// Tempo
await sleep(1000); // aguarda 1 segundo
msToTime(3661000); // "01h 01m 01s"

// Formatação
formatBytes(1024); // "1 KB"

📚 Funções Disponíveis

✅ Validação (validation)

  • isEmail(email: string): boolean - Valida endereço de email
  • isUrl(url: string): boolean - Valida URL
  • isNumeric(text: string): boolean - Valida se é numérico
  • isDefined(value: any): boolean - Verifica se valor está definido
  • isPromise(value: any): boolean - Verifica se é uma Promise

🔍 Verificação (check)

  • equalsIgnoreCase(text1: string, text2: string): boolean - Compara strings ignorando maiúsculas
  • includesIgnoreCase(text: string, query: string): boolean - Busca em string ignorando maiúsculas

⏱️ Tempo (timers & sleep)

  • sleep(ms: number): Promise<void> - Aguarda tempo especificado
  • setIntervalAsync(callback, delay, immediate?): Promise<void> - Intervalo assíncrono
  • setTimeoutAsync(callback, delay): Promise<void> - Timeout assíncrono

🔄 Conversão (convert & ms)

  • msToTime(ms: number): string - Converte milissegundos para formato legível (ex: "01h 30m 45s")
  • timeToMs(time: string): number - Converte formato de tempo para milissegundos

📅 Data (date)

  • Funções para manipulação e formatação de datas

🧮 Matemática (math)

  • Funções utilitárias de matemática

📏 Formatação (format)

  • formatBytes(bytes: number): string - Formata bytes para unidade legível (KB, MB, GB, etc)
  • Outras funções de formatação

🛠️ Utilitários (with)

  • Funções utilitárias gerais

📂 Estrutura do Projeto

src/
├── index.ts
└── functions/
    ├── check.ts          # Verificações de string
    ├── convert.ts        # Funções de conversão
    ├── date.ts           # Manipulação de datas
    ├── format.ts         # Formatação de dados
    ├── math.ts           # Funções matemáticas
    ├── ms.ts             # Conversão de tempo
    ├── sleep.ts          # Delay assíncrono
    ├── timers.ts         # Timers assíncronos
    ├── validation.ts     # Validações
    ├── with.ts           # Utilitários gerais
    └── index.ts          # Exportações

🔧 Desenvolvimento

Build

npm run build

Compila TypeScript para JavaScript em build/.

Scripts Disponíveis

  • npm run build - Compila o projeto

📝 Exemplo Completo

import { isEmail, isDefined, sleep, formatBytes } from "@zadytach/core";

async function exampleFunction() {
  // Validar email
  if (isEmail("[email protected]")) {
    console.log("Email válido!");
  }

  // Aguardar 2 segundos
  await sleep(2000);
  console.log("2 segundos se passaram");

  // Formatar tamanho de arquivo
  const fileSize = formatBytes(5242880);
  console.log(`Tamanho: ${fileSize}`); // "Tamanho: 5 MB"
}

exampleFunction();

🤝 Contribuição

Contribuições são bem-vindas! Se encontrou um bug ou tem sugestões, abra uma issue.

📄 Licença

Este projeto está licenciado sob a licença MIT - veja o arquivo LICENSE para detalhes.

👨‍💻 Autor

HelzadyDev