super-utilz
v2.0.0
Published
Private Utils
Readme
super-utilz ⚡
🚨 WARNING 🚨
This NPM package is just a collection of small helper functions. Don't use it unless you really need it. 🛑 **This package offers the following function categories:
Each category is exported from a respective folder. 📁The below functions are all exported from the super-utilz folder. Each function is exported from a folder.
export {
createDate,
createDateFromNowWithOffset,
fsDeleteDirectory,
fsDeleteFile,
downloadFileFromUrl,
fsReadJSONFile,
fsWriteJsonToFile,
fsWriteToFile,
fsGetFile,
fsReadFile,
generateRandomNumberBetween,
randomStringOfLength,
genOpensslRand,
} from "@/util";
export { isValidIpAddress, isValidJson, isValidUrl } from "@/isValid";
export { bytesToMb, epochToDate } from "@/convert";
export * from "@/helpers";Utility Functions 🛠️
- createDate: Convert date to formatted string 📅
- createDateFromNowWithOffset: Create date with offset 🕒
- fsDeleteDirectory: Delete directory 🗑️
- fsDeleteFile: Delete file 🗑️
Validation Helpers ✔️
- isValidIpAddress: Validate IP address 🌐
- isValidJson: Validate JSON 📝
- isValidUrl: Validate URL 🔗
Conversion Utilities 🔄
- bytesToMb: Convert bytes to megabytes 💾
- epochToDate: Transform epoch time to date ⏰
Miscellaneous Helpers 🎩
- downloadFileFromUrl: Download file from URL ⬇️
- fsReadJSONFile: Read JSON file 📂
- fsWriteJsonToFile: Write JSON to file 📝
- fsWriteToFile: Write to file 📝
So there you have it. A package you probably don't need, but hey, it's here if you want it. Use it wisely, or don't use it at all. Either way, we won't judge. 🎉
# Installation
# To install `super-utilz`, you can use npm, yarn, or pnpm.
npm install super-utilz
# or
yarn add super-utilz
# or
pnpm add super-utilzUsage
Once installed, you can use the functions from super-utilz in your Node.js project:
const { createDateFromNowWithOffset, isValidIpAddress } = require('super-utilz');
// Example usage
const date = createDateFromNowWithOffset(5);
console.log(date); // Result: will be a date in the past 5 days
const ip = '192.168.1.1';
if (isValidIpAddress(ip)) {
console.log('Valid IP address!');
} else {
console.log('Invalid IP address!');
}API Documentation
Contributing
Contributions are welcome! If you find any bugs or have suggestions for improvement, please open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
- All changes are tracked in the RELEASES file.
- You can track changes in the releases update from
github. - Note that this is not the same as the changelog.
- We do not provide changelog for this package.
- Also we not interested in support for this package.
- You can track changes in the releases update from
Version History
v1.1.0 And Later:
- No more updates to README.md and CHANGELOG. 🥲
- Only very major changes will be listed.
NOT SURE
v1.0.1 (2024-03-30):
- Added readme and setup instructions
v1.0.0 (2024-03-26):
- Initial release 🎉
Credits
- Author: Bhuvan
Support
If you encounter any issues or need assistance, please feel free to open an issue on GitHub.
