You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

min-dash

Package Overview
Dependencies
Maintainers
9
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-dash

Minimum utility toolbelt


Version published
Weekly downloads
116K
decreased by-17%
Maintainers
9
Install size
64.7 kB
Created
Weekly downloads
 

Package description

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

Changelog

Source

4.2.1

  • FIX: correct isNil and isArray type definitions (#35)

Readme

Source

min-dash

CI

Minimal utility tool belt to be used with bpmn.io related libraries.

Features

  • fine selection of powerful utilities on board
  • ES2015 compatible
  • complete bundle < 2 kB minified and gzipped
  • utilities optimized for speed (i.e. sorting and union only by key)

How to use

import {
  find,
  sortBy,
  assign
} from 'min-dash';

Your favourite module bundler should apply tree-shaking to only include the components your application requires. If you're using CommonJS modules give common-shake a try.

  • 1-liners - a slightly more opinionated collection of useful utilities
  • min-dom - minimal DOM utility toolbelt
  • tiny-svg - tiny SVG utility toolbelt

License

MIT

Keywords

FAQs

Package last updated on 17 Jan 2024

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc