New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

xrg-utils

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

xrg-utils

A modern collection of reusable utility functions for JavaScript and TypeScript, designed to simplify everyday development tasks.

Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

xrg-utils

A collection of utility functions for common JavaScript/TypeScript.A modern collection of reusable utility functions for JavaScript and TypeScript, designed to simplify everyday development tasks.

Installation

npm install xrg-utils

Available Utilities

pipeline
import utils from "xrg-utils";

const [op1, op2] = utils.pipeline({
   input: [5, 2, 8, 3, 1, 4],
   filter: (num) => num % 2 === 0,
   map: {
      matched: (num) => num * num,
      unmatched: (num) => -num,
   },
   sort: {
      matched: (a, b) => a - b,
      unmatched: (a, b) => a - b,
   },
});

console.log("op1:", op1); // [4, 16, 64]
console.log("op2:", op2); // [-5, -3, -1]
generatePassword
import utils from "xrg-utils";

utils.generatePassword(12); // Generates a 12-character password
getBase64
import utils from "xrg-utils";

// For files:
const fileBase64 = await utils.getBase64(file);
slug
import utils from "xrg-utils";

const urlSlug = utils.slug("Some String to Slugify"); // "some-string-to-slugify"
truncate
import utils from "xrg-utils";

const shortText = utils.truncate("Very long text here", 10); // "Very long..."\

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to contribute to this project.

License

This package is open-source and available under the MIT License.

Keywords

javascript

FAQs

Package last updated on 16 Jul 2025

Related posts