Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.
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);
Lodash is a modern JavaScript utility library delivering modularity, performance, and extras. It provides a wide range of utility functions for arrays, objects, strings, and more, similar to Mout. Lodash is known for its performance optimizations and extensive documentation.
Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. It offers similar functionalities to Mout, such as array and object manipulation, but is generally considered less performant than Lodash.
Ramda is a practical functional library for JavaScript programmers. It focuses on immutability and pure functions, providing utilities for functional programming. While it offers similar utilities to Mout, Ramda emphasizes a functional approach and currying.
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.
Online documentation can be found at http://moutjs.com/ or inside the
doc
folder.
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
Released under the MIT License.
v0.7.1 (2013/09/18)
null
value handling in object/get.FAQs
Modular Utilities
The npm package mout receives a total of 258,392 weekly downloads. As such, mout popularity was classified as popular.
We found that mout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.