Welcome to rjutils-collection 👋
Easy and Lightweight Utilities
Install
npm i rjutils-collection
or
yarn add rjutils-collection
Usage
Loading an env File as json
const path = require('node: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'
})
Author
👤 0x4096
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2023 0x4096.
This project is MIT licensed.