Socket
Socket
Sign inDemoInstall

mout

Package Overview
Dependencies
0
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mout

Modular Utilities


Version published
Maintainers
4
Install size
400 kB
Created

Package description

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

Changelog

Source

v0.10.0 (2014/09/02)

  • add array/equals;
  • add array/groupBy;
  • add array/last;
  • add function/wrap;
  • add lang/GLOBAL;
  • add lang/isPrimitive;
  • add number/MAX_SAFE_INTEGER;
  • add object/omit;
  • add object/result;
  • add object/result;
  • add random/randString;
  • change lang/isEmpty behavior to return true for any value that isn't a collection.
  • fix array/findLastIndex to stop at zero index;
  • improve function/partial to accept placeholders;
  • improve math.norm behavior for values outside the range and for cases where val === min === max;
  • improve object/get behavior to return properties from any value that is not null or undefined;
  • move object/deepEquals to lang/deepEquals (improving the behavior);

Readme

Source

mout

http://moutjs.com/

Build Status

All code is library agnostic and consist mostly of helper methods that aren't directly related with the DOM, the purpose of this library isn't to replace Dojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common problems that aren't solved by most of them. Consider it as a crossbrowser JavaScript standard library.

Main goals

  • increase code reuse;
  • be clear (code should be clean/readable);
  • be easy to debug;
  • be easy to maintain;
  • follow best practices;
  • follow standards when possible;
  • don't convert JavaScript into another language!
  • be compatible with other frameworks;
  • be modular;
  • have unit tests for all modules;
  • work on multiple environments (IE7+, modern browsers, node.js);

What shouldn't be here

  • UI components;
  • CSS selector engine;
  • Event system - pub/sub;
  • Template engine;
  • Anything that isn't generic enough to be on a standard library;
  • Anything that could be a separate library and/or isn't a modular utility...

API Documentation

Online documentation can be found at http://moutjs.com/ or inside the doc folder.

FAQ / Wiki / IRC

For more info about project structure, design decisions, tips, how to contribute, build system, etc, please check the project wiki.

We also have an IRC channel #moutjs on irc.freenode.net

License

Released under the MIT License.

Keywords

FAQs

Last updated on 02 Sep 2014

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc