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

mout

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mout

Modular Utilities

  • 1.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
331K
decreased by-5.86%
Maintainers
4
Weekly downloads
 
Created

What is mout?

The 'mout' npm package is a comprehensive utility library that provides a wide range of functions for various tasks such as array manipulation, object handling, string operations, and more. It is designed to be modular, allowing developers to include only the specific utilities they need.

What are mout's main functionalities?

Array Utilities

Mout provides various array manipulation functions such as shuffle, flatten, and unique. In this example, the 'shuffle' function is used to randomly shuffle the elements of an array.

const mout = require('mout');
const arr = [1, 2, 3, 4, 5];
const shuffled = mout.array.shuffle(arr);
console.log(shuffled);

Object Utilities

Mout offers a range of object utilities like deep cloning, merging, and key extraction. This example demonstrates the 'keys' function, which retrieves all the keys of an object.

const mout = require('mout');
const obj = { a: 1, b: 2, c: 3 };
const keys = mout.object.keys(obj);
console.log(keys);

String Utilities

String manipulation functions such as capitalize, trim, and escape are available in Mout. The example shows the 'capitalize' function, which capitalizes the first letter of a string.

const mout = require('mout');
const str = 'hello world';
const capitalized = mout.string.capitalize(str);
console.log(capitalized);

Function Utilities

Mout includes function utilities like debounce, throttle, and memoize. This example uses the 'debounce' function to limit the rate at which a function can be executed.

const mout = require('mout');
const debounce = mout.function.debounce;
const log = () => console.log('Debounced!');
const debouncedLog = debounce(log, 1000);
debouncedLog();

Number Utilities

Number utilities such as round, clamp, and random are part of Mout. The example demonstrates the 'round' function, which rounds a number to a specified number of decimal places.

const mout = require('mout');
const num = 123.456;
const rounded = mout.number.round(num, 2);
console.log(rounded);

Other packages similar to mout

Keywords

FAQs

Package last updated on 19 Sep 2022

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