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

min-dash

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-dash

Minimum utility toolbelt

  • 2.4.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is min-dash?

The min-dash npm package is a minimal utility library for JavaScript that provides a set of functions for common programming tasks. It is designed to be lightweight and efficient, making it suitable for use in performance-sensitive applications.

What are min-dash's main functionalities?

Array Manipulation

min-dash provides functions like `filter` and `map` to manipulate arrays. `filter` is used to create a new array with all elements that pass the test implemented by the provided function. `map` creates a new array with the results of calling a provided function on every element in the calling array.

const { filter, map } = require('min-dash');

const numbers = [1, 2, 3, 4, 5];
const evenNumbers = filter(numbers, n => n % 2 === 0);
const squaredNumbers = map(numbers, n => n * n);

console.log(evenNumbers); // [2, 4]
console.log(squaredNumbers); // [1, 4, 9, 16, 25]

Object Manipulation

min-dash provides functions like `assign` and `keys` for object manipulation. `assign` is used to copy the values of all enumerable own properties from one or more source objects to a target object. `keys` returns an array of a given object's own enumerable property names.

const { assign, keys } = require('min-dash');

const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };
const mergedObj = assign({}, obj1, obj2);
const objKeys = keys(mergedObj);

console.log(mergedObj); // { a: 1, b: 3, c: 4 }
console.log(objKeys); // ['a', 'b', 'c']

Function Utilities

min-dash provides function utilities like `bind` and `debounce`. `bind` creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. `debounce` creates a debounced function that delays invoking the provided function until after a specified wait time has elapsed since the last time the debounced function was invoked.

const { bind, debounce } = require('min-dash');

function greet(name) {
  console.log('Hello ' + name);
}

const boundGreet = bind(greet, null, 'World');
boundGreet(); // 'Hello World'

const debouncedGreet = debounce(greet, 1000);
debouncedGreet('Alice');
debouncedGreet('Bob'); // Only 'Hello Bob' will be logged after 1 second

Other packages similar to min-dash

Keywords

FAQs

Package last updated on 01 Apr 2018

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