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

@sailshq/lodash

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sailshq/lodash

A fork of Lodash 3.10.x with ongoing maintenance from the Sails core team.

  • 3.10.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
123K
decreased by-3.69%
Maintainers
5
Weekly downloads
 
Created

What is @sailshq/lodash?

@sailshq/lodash is a fork of the popular Lodash library, tailored specifically for use with the Sails.js framework. It provides utility functions for common programming tasks using a functional programming paradigm.

What are @sailshq/lodash's main functionalities?

Array Manipulation

The chunk function splits an array into groups of a specified size. This is useful for breaking down large datasets into manageable chunks.

const _ = require('@sailshq/lodash');
const array = [1, 2, 3, 4, 5];
const chunkedArray = _.chunk(array, 2);
console.log(chunkedArray); // [[1, 2], [3, 4], [5]]

Object Manipulation

The pick function creates an object composed of the picked object properties. This is useful for selecting specific properties from an object.

const _ = require('@sailshq/lodash');
const object = { 'a': 1, 'b': '2', 'c': 3 };
const picked = _.pick(object, ['a', 'c']);
console.log(picked); // { 'a': 1, 'c': 3 }

String Manipulation

The capitalize function converts the first character of a string to upper case and the remaining to lower case. This is useful for formatting strings.

const _ = require('@sailshq/lodash');
const str = 'hello world';
const capitalized = _.capitalize(str);
console.log(capitalized); // 'Hello world'

Collection Manipulation

The filter function iterates over elements of a collection, returning an array of all elements that pass a predicate check. This is useful for filtering data sets.

const _ = require('@sailshq/lodash');
const users = [
  { 'user': 'barney', 'age': 36, 'active': true },
  { 'user': 'fred', 'age': 40, 'active': false }
];
const activeUsers = _.filter(users, { 'active': true });
console.log(activeUsers); // [{ 'user': 'barney', 'age': 36, 'active': true }]

Other packages similar to @sailshq/lodash

Keywords

FAQs

Package last updated on 06 Apr 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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc