
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@rjweb/utils
Advanced tools
Easy and Lightweight Utilities
# NPM
npm install @rjweb/utils
# Yarn
yarn add @rjweb/utils
# pNPM
pnpm add @rjweb/utils
Generating a Random Number in Range
const { number } = require('@rjweb/utils')
const min = 50
const max = 100
const result = number.generate(min, max)
Generating a Random String
const { string } = require('@rjweb/utils')
const result = string.generate({
length: 25,
numbers: true,
symbols: true,
uppercase: true,
lowercase: true
})
Encrypting a String
const { string } = require('@rjweb/utils')
const result = string.encrypt('Hello', 'secret', {
output: 'hex'
})
Decrypting a String
const { string } = require('@rjweb/utils')
const result = string.decrypt('df4d0fe46e0210d4ef46368a6c3d56bb', 'secret', {
input: 'hex'
})
Hashing a String
const { string } = require('@rjweb/utils')
const result = string.hash('Hello', {
salt: 'secret',
algorithm: 'sha256',
output: 'hex'
})
Parsing Options
const { object } = require('@rjweb/utils')
const original = {
ssl: true,
maxRequests: 10000,
other: {
clock: true,
date: {
enabled: true,
timezone: 'UTC'
}
}
}
const userProvided = {
ssl: false,
other: {
date: {
timezone: 'CET'
}
}
}
const result = object.deepParse(original, userProvided)
/**
* {
* ssl: false,
* maxRequests: 10000,
* other: {
* clock: true,
* date: {
* enabled: true,
* timezone: 'CET'
* }
* }
* }
*/
👤 0x7d8
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2023 0x7d8.
This project is MIT licensed.
1.0.0
FAQs
Easy and Lightweight Utilities
We found that @rjweb/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.