Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
dev-utils-ts
Advanced tools
This repository contains a collection of useful utility functions to simplify your day-to-day coding tasks. These functions are designed to enhance your development workflow and improve code readability. Feel free to explore and integrate them into your projects! 🚀
To use these utility functions in your project, simply install the package from npm:
npm install dev-utils-ts
withTempDirs
This function creates temporary directories, executes the provided callback function, and then cleans up all directories thereafter.
import {withTempDirs} from 'dev-utils-ts';
async function myFunction() {
try {
const result = await withTempDirs(['/tmp/dir1', '/tmp/dir2'], async () => {
// Your code that requires temporary directories goes here...
return 'Result of your awesome function';
});
console.log('Result:', result);
} catch (error) {
console.error('Error:', error);
}
}
replaceMultiple
This function replaces all occurrences of match strings with corresponding replacement strings in a given string.
import {replaceMultiple} from 'dev-utils-ts';
const originalString = 'Hello world! This is a beautiful day.';
const matchStrings = ['world', 'beautiful', 'day'];
const replacementStrings = ['universe', 'wonderful', 'morning'];
const modifiedString = replaceMultiple(originalString, matchStrings, replacementStrings);
console.log(modifiedString);
// Output: 'Hello universe! This is a wonderful morning.'
Contributions to this repository are welcome! Feel free to open an issue or submit a pull request with your improvement ideas. 💪
FAQs
utils which are required by developers in day today work
We found that dev-utils-ts 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.