Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dev-utils-ts

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dev-utils-ts

utils which are required by developers in day today work

  • 0.0.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

✨ Awesome Utility Functions ✨

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! 🚀

📦 Installation

To use these utility functions in your project, simply install the package from npm:

npm install dev-utils-ts

💡 Usage

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.'

🚀 Contributing

Contributions to this repository are welcome! Feel free to open an issue or submit a pull request with your improvement ideas. 💪

FAQs

Package last updated on 04 Aug 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc