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

nukes

v2.0.0

Published

Advanced enterprise-grade JavaScript utility library providing comprehensive data manipulation, performance optimization, security utilities, and development productivity tools for modern applications.

Readme

Nukes v2.0.0 - Enterprise-Grade JavaScript Utility Library

npm version License: MIT Node.js

A comprehensive, modular utility library for modern JavaScript development, providing enterprise-grade tools for data manipulation, performance optimization, security utilities, and development productivity.

🚀 Features

  • 📁 Modular Architecture - Clean separation of concerns with dedicated modules
  • ⚡ Zero Dependencies - Lightweight and self-contained
  • 🔧 TypeScript Ready - JSDoc annotations for excellent IDE support
  • 🏢 Enterprise-Grade - Production-ready utilities for real-world applications
  • 🧪 Comprehensive Testing - Extensive test coverage for all functionality
  • 📚 Rich Documentation - Complete API documentation with examples

📦 Installation

npm install nukes

🎯 Quick Start

const nukes = require('nukes');

// Array utilities
const unique = nukes.array.deduplicate([1, 1, 2, 3, 3]);
const chunks = nukes.array.chunk([1, 2, 3, 4, 5, 6], 2);

// Object utilities
const cloned = nukes.object.deepClone(complexObject);
const value = nukes.object.get(obj, 'user.profile.name');

// String utilities
const camelCase = nukes.string.toCamelCase('hello-world');
const truncated = nukes.string.truncate(longText, 50);

// Validation utilities
const isValid = nukes.validation.isEmail('[email protected]');

// Security utilities
const uuid = nukes.security.generateUUID();
const masked = nukes.security.maskSensitiveData('1234567890', 2);

// Async utilities
await nukes.async.delay(1000);
const result = await nukes.async.retry(unstableFunction);

// Get package info
console.log(nukes.info());

📚 API Documentation

📊 Array Module (nukes.array)

Advanced array manipulation and analysis utilities.

Core Functions

  • deduplicate(arr) - Remove duplicate values from array
  • compact(arr) - Remove falsy values from array
  • chunk(arr, size) - Split array into chunks of specified size
  • intersect(...arrays) - Find common elements across multiple arrays
  • groupBy(arr, criterion) - Group array elements by key or function
  • flatten(arr, depth) - Flatten nested arrays to specified depth
  • shuffle(arr) - Randomly shuffle array elements
// Examples
const numbers = [1, 1, 2, 3, 3, 4, 5];
const unique = nukes.array.deduplicate(numbers); // [1, 2, 3, 4, 5]

const data = [1, null, 2, false, 3, '', 4];
const clean = nukes.array.compact(data); // [1, 2, 3, 4]

const large = [1, 2, 3, 4, 5, 6, 7, 8];
const chunks = nukes.array.chunk(large, 3); // [[1,2,3], [4,5,6], [7,8]]

🗂️ Object Module (nukes.object)

Comprehensive object manipulation utilities.

Core Functions

  • deepClone(obj) - Create deep copy of object
  • deepMerge(...objects) - Deep merge multiple objects
  • get(obj, path, defaultValue) - Get nested property using dot notation
  • set(obj, path, value) - Set nested property using dot notation
  • pick(obj, keys) - Create object with only specified properties
  • omit(obj, keys) - Create object without specified properties
  • has(obj, path) - Check if nested property exists
// Examples
const original = { a: 1, b: { c: 2, d: [3, 4] } };
const cloned = nukes.object.deepClone(original);

const user = { profile: { name: 'John', email: '[email protected]' } };
const name = nukes.object.get(user, 'profile.name'); // 'John'

nukes.object.set(user, 'profile.age', 30);
// user.profile.age is now 30

🔤 String Module (nukes.string)

Advanced string manipulation and formatting utilities.

Core Functions

  • toCamelCase(str) - Convert to camelCase
  • toKebabCase(str) - Convert to kebab-case
  • toSnakeCase(str) - Convert to snake_case
  • toTitleCase(str) - Convert to Title Case
  • truncate(str, length, suffix) - Truncate string with ellipsis
  • pad(str, length, char, direction) - Pad string to specified length
  • escapeHtml(str) - Escape HTML special characters
  • normalizeWhitespace(str) - Normalize whitespace in string
  • extractWords(str) - Extract words from string
// Examples
const text = 'hello world example';
nukes.string.toCamelCase(text); // 'helloWorldExample'
nukes.string.toKebabCase(text); // 'hello-world-example'
nukes.string.toSnakeCase(text); // 'hello_world_example'

const long = 'This is a very long text';
nukes.string.truncate(long, 15); // 'This is a ve...'

✅ Validation Module (nukes.validation)

Comprehensive validation utilities for data types and formats.

Core Functions

  • isEmail(email) - Validate email address
  • isUrl(url) - Validate URL
  • isAlpha(str) - Check if string contains only letters
  • isAlphaNumeric(str) - Check if string contains only letters and numbers
  • isPhoneNumber(phone) - Validate phone number
  • isCreditCard(cardNumber) - Validate credit card number (Luhn algorithm)
  • isDate(date) - Check if value is valid date
  • isJson(str) - Check if string is valid JSON
  • isInRange(num, min, max) - Check if number is within range
  • isStrongPassword(password, options) - Validate password strength
// Examples
nukes.validation.isEmail('[email protected]'); // true
nukes.validation.isUrl('https://example.com'); // true
nukes.validation.isStrongPassword('MyPass123!'); // true

🧹 Console Module (nukes.console)

Enhanced console utilities for debugging and logging.

Core Functions

  • log(level, message, data) - Enhanced logging with timestamps and colors
  • createTimer(label) - Create execution timer
  • timeFunction(fn, label) - Time function execution
  • createProgressBar(total, width) - Create console progress bar
  • table(data, columns) - Display data in table format
  • prettyJson(data, indent) - Pretty print JSON
  • clear(header) - Clear console with optional header
  • group(label, fn) - Group console output
// Examples
nukes.console.log('info', 'Application started');
nukes.console.log('error', 'Database connection failed', error);

const timer = nukes.console.createTimer('API Call');
// ... do work ...
const elapsed = timer(); // Returns elapsed time in ms

nukes.console.table([
  { name: 'John', age: 30 },
  { name: 'Jane', age: 25 }
]);

⚡ Async Module (nukes.async)

Asynchronous operation utilities and helpers.

Core Functions

  • delay(ms) - Create promise delay
  • retry(fn, options) - Retry function with exponential backoff
  • withTimeout(fn, timeoutMs) - Execute function with timeout
  • batchExecute(tasks, batchSize) - Execute promises in batches
  • debounce(fn, delayMs) - Debounce function calls
  • throttle(fn, intervalMs) - Throttle function calls
  • promisify(fn) - Convert callback function to promise
// Examples
await nukes.async.delay(1000); // Wait 1 second

const result = await nukes.async.retry(
  () => unstableApiCall(),
  { maxAttempts: 3, baseDelay: 1000 }
);

const debouncedSave = nukes.async.debounce(saveFunction, 500);

🔒 Security Module (nukes.security)

Security utilities for data protection and validation.

Core Functions

  • generateRandomString(length, charset) - Generate random string
  • generateUUID() - Generate UUID v4
  • simpleHash(str) - Create simple hash (non-cryptographic)
  • base64Encode(str) - Base64 encode string
  • base64Decode(str) - Base64 decode string
  • sanitizeString(str, options) - Sanitize potentially dangerous strings
  • maskSensitiveData(str, visibleChars, maskChar) - Mask sensitive information
  • isSafeString(str, allowedPattern) - Check if string contains only safe characters
  • generateSecureToken(length) - Generate secure authentication token
// Examples
const uuid = nukes.security.generateUUID();
const token = nukes.security.generateSecureToken(32);

const encoded = nukes.security.base64Encode('Hello World');
const decoded = nukes.security.base64Decode(encoded);

const masked = nukes.security.maskSensitiveData('1234567890', 2);
// '12******90'

🛠 Convenience Methods

Access commonly used functions directly from the main object:

// These are shortcuts to frequently used functions
nukes.deduplicate(array);        // → nukes.array.deduplicate
nukes.deepClone(object);         // → nukes.object.deepClone
nukes.toCamelCase(string);       // → nukes.string.toCamelCase
nukes.isEmail(email);            // → nukes.validation.isEmail
nukes.delay(ms);                 // → nukes.async.delay
nukes.generateUUID();            // → nukes.security.generateUUID

📁 Project Structure

nukes/
├── index.js              # Main entry point
├── src/                  # Source modules
│   ├── array.js         # Array utilities
│   ├── object.js        # Object utilities
│   ├── string.js        # String utilities
│   ├── validation.js    # Validation utilities
│   ├── console.js       # Console utilities
│   ├── async.js         # Async utilities
│   └── security.js      # Security utilities
├── test.js              # Test suite
├── package.json         # Package configuration
└── README.md           # This file

🧪 Testing

Run the comprehensive test suite:

npm test

The test suite covers all 47+ utility functions across all modules with real-world scenarios.

📈 Performance

  • Optimized Algorithms: All functions use efficient algorithms optimized for performance
  • Memory Efficient: Minimal memory footprint with careful resource management
  • Zero Dependencies: No external dependencies means faster installation and smaller bundle size
  • Production Ready: Battle-tested utilities suitable for enterprise applications

🔧 Development

Package Information

// Get detailed package information
const info = nukes.info();
console.log(info);
// {
//   name: 'nukes',
//   version: '2.0.0',
//   description: 'Enterprise-grade JavaScript utility library',
//   modules: ['array', 'object', 'string', 'validation', 'console', 'async', 'security'],
//   author: 'sureokaycool'
// }

// List all available functions
const functions = nukes.listFunctions();
console.log(functions);

Requirements

  • Node.js: >= 14.0.0
  • Browser: Modern browsers with ES6+ support

🤝 Contributing

Contributions, issues, and feature requests are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

👤 Author

sureokaycool


Built with ❤️ for the JavaScript community

🌟 Why Choose Nukes?

  • 🏢 Enterprise Ready: Production-tested utilities for real-world applications
  • 📦 Modular Design: Use only what you need, when you need it
  • 🔧 Developer Friendly: Excellent TypeScript support and comprehensive documentation
  • ⚡ Performance Focused: Optimized algorithms and zero dependencies
  • 🛡️ Reliable: Extensive testing and error handling
  • 📚 Well Documented: Complete API documentation with practical examples

Transform your JavaScript development workflow with powerful, production-ready utilities. Install Nukes today and experience the difference! 🚀