
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
qumra-utils
Advanced tools
A collection of utility tools and helpers for Qumra platform developers. Simple and efficient utilities to enhance development experience both within Qumra ecosystem and for external developers.
A collection of utility tools and helpers for Qumra platform developers. Simple and efficient utilities to enhance development experience both within Qumra ecosystem and for external developers.
npm install qumra-utils
import {
formatDate,
getTimeAgo,
addDays,
toUTC,
isValidDate
} from 'qumra-utils';
// Format a date with custom format
formatDate(date: Date | string | number, format?: string): string
// Example: formatDate(new Date(), 'DD-MM-YYYY HH:mm:ss')
// Get relative time (e.g., "2 hours ago")
getTimeAgo(date: Date | string | number, locale?: 'en' | 'ar'): string
// Example: getTimeAgo(new Date(), 'ar')
// Add days to a date
addDays(date: Date | string | number, days: number): Date | null
// Example: addDays(new Date(), 7)
// Convert date to UTC
toUTC(date: Date | string | number): Date | null
// Example: toUTC(new Date())
// Check if a value is a valid date
isValidDate(date: any): boolean
// Example: isValidDate('2024-03-20')
import {
isValidPhoneNumber,
formatPhoneNumber
} from 'qumra-utils';
// Validate phone number
isValidPhoneNumber(phoneNumber: string, countryCode?: string): boolean
// Example: isValidPhoneNumber('+201234567890', 'EG')
// Format phone number to international format
formatPhoneNumber(phoneNumber: string, countryCode?: string): string | null
// Example: formatPhoneNumber('01234567890', 'EG')
import { isValidEmail } from 'qumra-utils';
// Validate email address
isValidEmail(email: string): boolean
// Example: isValidEmail('user@example.com')
import { slugify } from 'qumra-utils';
// Convert text to URL-friendly slug
slugify(text: string): string
// Example: slugify('Hello World!') // returns 'hello-world'
import {
deepClone,
deepMerge,
groupBy
} from 'qumra-utils';
// Create a deep copy of an object
deepClone<T>(value: T): T
// Example: deepClone({ nested: { value: 1 } })
// Deep merge two objects
deepMerge<T>(target: T, source: Partial<T>): T
// Example: deepMerge({ a: 1 }, { b: 2 })
// Group array items by key
groupBy<T>(array: T[], key: keyof T): Record<string, T[]>
// Example: groupBy(users, 'role')
import {
isValidMongoId,
isValidId
} from 'qumra-utils';
// Validate MongoDB ObjectId
isValidMongoId(id: string): boolean
// Example: isValidMongoId('507f1f77bcf86cd799439011')
// Validate ID (MongoDB ObjectId or numeric ID)
isValidId(id: string): boolean
// Example: isValidId('507f1f77bcf86cd799439011') // MongoDB ID
// Example: isValidId('12345') // Numeric ID
import {
parseDomain,
getSubdomain
} from 'qumra-utils';
// Parse domain information
parseDomain(url: string): TldtsResult
// Example: parseDomain('https://sub.example.com')
// Get subdomain from URL
getSubdomain(url: string): string | null
// Example: getSubdomain('https://sub.example.com')
import { getLocalIP } from 'qumra-utils';
// Get the local IP address of the current device
getLocalIP(): string | null
// Example: getLocalIP() // returns "192.168.1.100"
import {
formatDate,
isValidPhoneNumber,
slugify,
deepClone,
getLocalIP
} from 'qumra-utils';
// Format date
const formattedDate = formatDate(new Date(), 'DD-MM-YYYY');
console.log(formattedDate); // "20-03-2024"
// Validate phone number
const isValid = isValidPhoneNumber('+201234567890', 'EG');
console.log(isValid); // true
// Create URL slug
const slug = slugify('Hello World!');
console.log(slug); // "hello-world"
// Deep clone object
const original = { nested: { value: 1 } };
const cloned = deepClone(original);
// Get local IP address
const localIP = getLocalIP();
console.log(localIP); // "192.168.1.100"
ISC
FAQs
A collection of utility tools and helpers for Qumra platform developers. Simple and efficient utilities to enhance development experience both within Qumra ecosystem and for external developers.
The npm package qumra-utils receives a total of 8 weekly downloads. As such, qumra-utils popularity was classified as not popular.
We found that qumra-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.