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

@goatlab/node-utils

v0.11.1

Published

Readable query Interface & API generator for TS and Node

Readme

@goatlab/node-utils

Node.js-specific utilities for common server-side tasks including JWT handling, security operations, stream processing, and environment management.

Installation

npm install @goatlab/node-utils
# or
yarn add @goatlab/node-utils
# or
pnpm add @goatlab/node-utils

Usage Examples

JWT Operations

import { Jwt } from '@goatlab/node-utils'

// Sign a token
const token = await Jwt.sign({ userId: '123' }, 'your-secret', { expiresIn: '1h' })

// Verify a token
const payload = await Jwt.verify(token, 'your-secret')

Security & Encryption

import { Security, Hashes } from '@goatlab/node-utils'

// Generate secure random strings
const password = Security.randomString(16)
const apiKey = Security.randomString(32, { includeSymbols: true })

// Encrypt/decrypt data
const encrypted = Security.encrypt('sensitive data', 'secret-key')
const decrypted = Security.decrypt(encrypted, 'secret-key')

// Generate RSA key pair
const { publicKey, privateKey } = Security.generateKeyPair()

// Hash passwords
const hash = await Hashes.hash('password123')
const isValid = await Hashes.verify('password123', hash)

Stream Processing

import { Streams } from '@goatlab/node-utils'

// Transform streams with pipeline
await Streams.pipeline(
  readableStream,
  Streams.map(async (item) => ({ ...item, processed: true })),
  Streams.filter((item) => item.valid),
  Streams.gzip(),
  Streams.toWriteStream('./output.gz')
)

// Parse NDJSON
await Streams.pipeline(
  fs.createReadStream('./data.ndjson'),
  Streams.parseJson(),
  Streams.logProgress('Processing'),
  writableStream
)

Environment & Process Management

import { Env, Processes } from '@goatlab/node-utils'

// Get environment info
const buildInfo = Env.getBuildInfo()
const isProduction = Env.isProduction()

// Execute shell commands
const result = await Processes.run('npm list')

// Find available port
import { Ports } from '@goatlab/node-utils'
const port = await Ports.findPort(3000)
const availablePort = await Ports.getAvailablePort()

Scripts & Command Execution

import { Scripts, runScript } from '@goatlab/node-utils'

// Run async scripts with automatic error handling
runScript(async () => {
  await doSomething()
  console.log('Script completed')
})

// Execute shell commands with signal handling
await Scripts.runCommand('npm build', { cwd: './packages/app' })

// Capture command output
const output = await Scripts.runCommand('git status', { 
  captureOutput: true,
  silent: true 
})

Available Utilities

Authentication & Security

  • Jwt - JWT token signing and verification
  • Security - Encryption, decryption, random string generation, RSA key pairs
  • Hashes - Password hashing (bcrypt), MD5, SHA256 hashing
  • Secrets - Generate secure random secrets

Stream Processing

  • Streams - Pipeline builder with transforms: map, filter, buffer, gzip, JSON parsing, progress logging

System & Environment

  • Env - Environment detection and build info
  • Processes - Shell command execution
  • Ports - Find available network ports
  • Folders - Directory operations
  • Scripts - Run Node.js scripts and shell commands programmatically

Data & Utilities

  • ObjectIds - BSON ObjectId generation and validation
  • Ips - IP address utilities
  • Log - Winston logger instance