This package has been deprecated

Author message:

package renamed to purekit, this package will be removed from npm and yarn soon

alt-lodash
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Alternate of Lodash Library

https://alt-lodash.vercel.app


CI Rate this package Join the chat at https://gitter.im/alt-lodash/developers

tree shaking nodejs

npm version license Types Included

dependents weekly downloads weekly downloads downloads jsDelivr

minified gzip

Installation

With Yarn:

yarn add alt-lodash

With npm:

npm install alt-lodash

Usage

//  import all available the methods

import _ from 'alt-lodash';     //  ESM ( ECMA Script ) module

or

const _ = require('alt-lodash');    //  cjs ( common js ) module
//  import specific methods instead of all

import { concat, chunk, forEach, filter } from 'alt-lodash';     //  ESM ( ECMA Script ) module

or

const { concat, chunk, forEach, filter } = require('alt-lodash');    //  cjs ( common js ) module

Array


Collection


Dates


Function


Lang


Math


Number


Object


String


Util


Seq

  • _ ( 🔜 - Work in progress - PRs most welcome )

  • chain

  • chain2 ✔️ ( Alternate of chain method with minimal code )

    chain2(value)

    Arguments

    value (*): The value to wrap.

    Returns

    (Object): Returns the new wrapper instance.

    Example

    import { chain2, map, sortBy, head } from 'alt-lodash';
    
    const users = [
        { 'user': 'barney', 'age': 36 },
        { 'user': 'fred', 'age': 40 },
        { 'user': 'pebbles', 'age': 1 }
    ];
    
    const youngest = chain2(users)
        .fn(sortBy, 'age')
        .fn(map, (function (o: any) {
            return o.user + ' is ' + o.age;
        }))
        .fn(head)
        .value();
    
    // => 'pebbles is 1'
  • tap

  • tap2 ✔️ ( Alternate of tap method with minimal code )

    tap2(value, interceptor)

    Arguments

    value (*): The value to provide to interceptor.
    interceptor (Function): The function to invoke.

    Returns

    (*): Returns value.

    Example

    import { tap2, concat } from 'alt-lodash';
    
    const data = [1, 2, 3];
    
    const tappedData = tap2(data, (array: number[]) => {
        // Mutate input array.
        array.push(100);
    })
        .fn(concat, [4])
        .fn(concat, [5])
        .value();
    
    // => [1, 2, 3, 100, 4, 5]
  • thru ✔️

  • prototype[Symbol.iterator] ( 🔜 - Work in progress - PRs most welcome )

  • prototype.at ( 🔜 - Work in progress - PRs most welcome )

  • prototype.chain ( 🔜 - Work in progress - PRs most welcome )

  • prototype.commit ( 🔜 - Work in progress - PRs most welcome )

  • prototype.next ( 🔜 - Work in progress - PRs most welcome )

  • prototype.plant ( 🔜 - Work in progress - PRs most welcome )

  • prototype.reverse ( 🔜 - Work in progress - PRs most welcome )

  • prototype.toJSON -> value ( 🔜 - Work in progress - PRs most welcome )

  • prototype.value ( 🔜 - Work in progress - PRs most welcome )

  • prototype.valueOf -> value ( 🔜 - Work in progress - PRs most welcome )

Package Sidebar

Install

npm i alt-lodash

Weekly Downloads

7

Version

1.0.5

License

MIT

Unpacked Size

834 kB

Total Files

355

Last publish

Collaborators

  • punitsonime