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

@neetru/db-fixtures

v0.1.0

Published

Gerador de dados sinteticos deterministico para as suites de teste do Neetru Core DB. PRNG semeado (mulberry32) + geradores de campo. Mesma semente produz exatamente as mesmas linhas, em qualquer SO, toda execucao. Zero dependencias de runtime.

Readme

@neetru/db-fixtures

Gerador de dados sinteticos deterministico para as suites de teste do Neetru Core DB. Um faker minusculo: um PRNG semeado mais geradores de campo.

O que e

As suites de teste precisam de dados falsos reproduziveis. A mesma semente precisa sempre produzir exatamente as mesmas linhas, em qualquer sistema operacional, toda execucao. Este pacote entrega isso — e nada alem disso.

A garantia central:

  • O PRNG e o mulberry32, um gerador conhecido, minusculo e com boa distribuicao, com estado de 32 bits.
  • Nada de Math.random, Date.now nem crypto. So aritmetica inteira/float pura. O determinismo cross-OS e o produto.
  • Sementes string sao hasheadas via FNV-1a 32 bits; sementes numericas sao coagidas para uint32.

Funcoes puras, zero dependencias de runtime.

API

import {
  createRng,
  fakeFullName,
  fakeEmail,
  fakeUuid,
  fakeIsoDate,
  fakeSentence,
  fakeInt,
  generateRows,
} from '@neetru/db-fixtures';

createRng(seed)

Cria um SeededRng deterministico. seed pode ser string ou number.

interface SeededRng {
  next(): number;                          // float em [0, 1)
  int(min: number, max: number): number;   // inteiro, inclusivo nas duas pontas
  bool(): boolean;                         // next() < 0.5
  pick<T>(arr: readonly T[]): T;            // um elemento do array
}
  • int lanca se min > max ou se min/max nao forem inteiros finitos.
  • pick lanca se o array for vazio.

Geradores de campo

Cada gerador consome estado do SeededRng que recebe — chamadas sucessivas avancam o gerador.

| Funcao | Retorno | |---|---| | fakeFullName(rng) | "<First> <Last>" | | fakeEmail(rng) | first.last<n>@<dominio>, minusculo, forma valida | | fakeUuid(rng) | string no formato UUID v4, deterministica (NAO crypto.randomUUID) | | fakeIsoDate(rng) | string ISO 8601 numa faixa plausivel (2020-2026) | | fakeSentence(rng) | frase curta capitalizada terminada em . | | fakeInt(rng, min, max) | inteiro em [min, max] |

generateRows(spec, count, seed)

Gera count linhas aplicando um spec de geradores de campo.

const userSpec = {
  id: (rng) => fakeUuid(rng),
  name: (rng) => fakeFullName(rng),
  email: (rng) => fakeEmail(rng),
  age: (rng) => fakeInt(rng, 18, 80),
};

const rows = generateRows(userSpec, 100, 'seed-da-suite');
// mesma (spec, count, seed) -> sempre as mesmas 100 linhas
  • count deve ser um inteiro nao-negativo; count === 0 devolve [].
  • O spec nunca e mutado.
  • As chaves do spec sao iteradas em ordem estavel (Object.keys(spec).sort()), de modo que a ordem de consumo do rng — e portanto a saida — nao depende da ordem de insercao das chaves no objeto spec.

A garantia de determinismo

Para a mesma (spec, count, seed), generateRows devolve uma saida deeply-equal em toda chamada, em qualquer maquina. Um unico SeededRng e criado da semente e reutilizado por todas as linhas e campos; a ordem de iteracao das chaves e ordenada. Nada le o relogio, o ambiente ou uma fonte de entropia. Sementes diferentes produzem dados diferentes.

Desenvolvimento

npm run build   # tsc -> dist/
npm test        # vitest run