npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ebay/nodash

v1.1.1

Published

Replacement for lodash, with fraction of the size.

Downloads

4

Readme

nodash

Replacement for subset of lodash, with fraction of the size.

Installation

npm i @ebay/nodash

Usage

Simply replace lodash with @ebay/nodash

const get = require('lodash/get');

// becomes

const get = require('@ebay/nodash/get');

Why?

Often, consumers of lodash use just a handful of the methods. Lodash makes this convenient by only requiring what you need:

const get = require('lodash/get'); // or require('lodash.get') if installed

However, Lodash is optimized as an entire library, which is to say it makes heavy reuse of its own methods. So using get may require baseGet, which requires castPath and toKey, which then requires isKey, stringToPath, and isSymbol... and so forth. It keeps going for many more levels.

This ends up with a bundle size of over 7kb just for using get. While that becomes cheaper the more you use Lodash, if all you use is get, it remains quite expensive. The Nodash version of the same method weighs in at ~500b for comparison.

As such, this library is targeted for just those users that need a small subset of Lodash, and not the whole library. It is not intended to be a replacement for Lodash.

Methods

Most methods are identical to Lodash. Some methods have partial support, to shed off edge cases for the sake of saving size. The API for all are otherwise identical to Lodash and can be a drop-in replacement in most cases.

Name | Same as Lodash? | Notes --- | --- | --- get | yes | get(obj, 'path.to[0].value', defaultValue) set | yes | set(obj, 'path.to[0].value', value) has | yes | has(obj, 'path.to[0].value') cloneDeep | yes | cloneDeep(obj) castArray | yes | castArray(value) isEmpty | no | does not support TypedArray or Buffers. isEmpty(value) isEqual | no | only does shallow comparison partial | yes | partial(func, param1, param2) partialRight | yes | partialRight(func, param1, param2) throttle | no | does not support trailing call throttle(func, 200)

License

Copyright 2018-2019 eBay Inc. Author/Developer: Scott Davis

Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

Third Party Code Attribution and Licenses

This software contains code licensed by third parties. In particular, see : https://github.com/lodash/lodash/blob/master/LICENSE

Copyright JS Foundation and other contributors https://js.foundation/

Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/

This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history available at https://github.com/lodash/lodash