Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
befree-utilities
Advanced tools
This npm library will be of personal use. However, it can be useful for external developers as well. It will receive new features with time depending on my needs
npm i befree-utilities
This npm library will be of personal use. However, it can be useful for external developers as well. It will receive new features with time depending on my needs
import { currencyFormatter, stripeCurrencyFormatter } from "befree-utilities";
// Description: Formats a number directly into a localized currency string
// Input example: currencyFormatter(12345.56, "USD");
// Output example: "$1, 234.56"
console.log('Result of currency formatter:', currencyFormatter(12345.56, "USD"));
// Description: Formats a number given in the smallest currency format unit (e.g., cents) into a localized currency string
// Input example: stripeCurrencyFormatter(1234556, "USD");
// Output example: "$1, 234.56"
console.log('Result of Stripe currency formatter:', stripeCurrencyFormatter(1234556, "USD"));
import { base64toBlob } from "befree-utilities";
// Description: Converts a base64-encoded string into a binary blob and
// optionally creates a File object and a url for the blob
// Input example: const file = base64toBlob(iVBORw0KGgoAAAANSUhEUgAAAAUA...); // (truncated Base64 string for brevity)
// Output example:
// console.log(file);
// {
// blob: Blob { size: 522, type: "" }, // Binary blob representation
// file: File { name: "fiename.jpg", size: 522, type: "image/jpg" }
// url: "blob:http://example/com/abc123" // Object Url for the blob
// }
const file = base64toBlob("iVBORw0KGgoAAAANSUhEUgAAAAUA..."); // (truncated Base64 string for brevity)
console.log('Result of base64toBlob:', file);
import { calculateTimeSincePublished, formatDateWithoutTime } from "befree-utilities";
// Description: Calculates the time elapsed since a given date and returns it as a human-readable string
// Input example: calculateTimeSincePublished("2024-11-28T10:00:00Z");
// Output example: "2 days ago"
console.log(calculateTimeSincePublished("2024-11-28T10:00:00Z"));
// Description: Formats a given date into a human-readable string, showing only the date without the time
// Input example: formatDateWithoutTime("2024-11-28T10:00:00Z");
// Output example: "11/28/2024" // (for en-US locale)
console.log(formatDateWithoutTime("2024-11-28T10:00:00Z"));
import { checkEmptyObject } from "befree-utilities";
// Description: Checks if an object is empty (i.e., has no own properties) and returns true if it is empty, otherwise false.
// Input example:
// checkEmptyObject({}); // Empty object
// checkEmptyObject({ key: "value" }); // Non-empty object
// Output example:
// true fo the empty object
// false for the object with properties
console.log(checkEmptyObject({}));
import { capitalizeWordsInArray } from "befree-utilities";
// Description: Take an array of words and returns a new array where each word is capitalized
// Input example: capitalizeWordsInArray(["hello", "world", "JAVASCRIPT", ""]);
// Output example: ["Hello", "World", "Javascript"]
console.log(capitalizeWordsInArray(["hello", "world", "JAVASCRIPT", ""]))
The befree-utilities
community can be found on GitHub Discussions where you can ask questions and voice ideas.
Dude, I'm broke. If you find this useful, please don't hesitate to help me maintain it!.
TO UPDATE
I'm available to work with you guys. If you need a developer who specializes in MongoDB, Express, ReactJS/NextJS, NodeJS, Php and MySQL, then I'm you're guy!. Reach out to me at kuaf1998@gmail.com
.
You can also check my portfolio at my personal blog.
A list of co-authors that have helped improve this amazing library!
FAQs
This npm library will be of personal use. However, it can be useful for external developers as well. It will receive new features with time depending on my needs
We found that befree-utilities 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.