Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
rjutils-collection
Advanced tools
Easy and Lightweight Utilities
# NPM
npm install rjutils-collection
# Yarn
yarn add rjutils-collection
# pNPM
pnpm add rjutils-collection
Loading an env File as object
const path = require('path')
const utils = require('rjutils-collection')
const env = utils.loadEnv(path.join(__dirname, '.env'))
Generating a Random Number in Range
const utils = require('rjutils-collection')
const min = 50
const max = 100
const number = utils.randomNum(min, max)
Generating a Random Boolean
const utils = require('rjutils-collection')
const boolean = utils.randomBol()
Generating a Random String
const utils = require('rjutils-collection')
const string = utils.randomStr({
length: 25,
numbers: true,
symbols: true,
uppercase: true,
lowercase: true
})
Encrypting a String
const utils = require('rjutils-collection')
const result = utils.encryptString({
text: 'Hello, World!',
algorithm: 'sha256',
key: '123456789',
output: 'hex'
})
Decrypting a String
const utils = require('rjutils-collection')
const result = utils.decryptString({
text: 'cf5ca2c244e71e33e30d07d5c13a4502!',
algorithm: 'sha256',
key: '123456789',
output: 'utf8'
})
Hashing a String
const utils = require('rjutils-collection')
const result = utils.hashString({
text: 'Hello World again!',
algorithm: 'sha256',
digest: 'hex'
})
Parsing Options
const utils = require('rjutils-collection')
const original = {
ssl: true,
maxRequests: 10000,
other: {
clock: true,
date: {
enabled: true,
timezone: 'UTC'
}
}
}
const userProvided = {
ssl: false,
other: {
date: {
timezone: 'CET'
}
}
}
const result = utils.deepParseOptions(original, userProvided)
/**
* {
* ssl: false,
* maxRequests: 10000,
* other: {
* clock: true,
* date: {
* enabled: true,
* timezone: 'CET'
* }
* }
* }
*/
👤 0x4096
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2023 0x4096.
This project is MIT licensed.
FAQs
Easy and Lightweight Utilities
The npm package rjutils-collection receives a total of 5 weekly downloads. As such, rjutils-collection popularity was classified as not popular.
We found that rjutils-collection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.