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

@naverpay/hidash

v0.0.5

Published

improved lodash

Downloads

394

Readme

@naverpay/hidash

A modern, performance-focused alternative to Lodash.

Features

  • 🚀 Dual Package Support (CJS, ESM): Built for modern JavaScript, optimized for tree-shaking
  • ⚡️ High Performance: Consistently faster than Lodash in benchmarks (verified with Vitest)
  • 🔄 Drop-in Replacement: 100% compatible with Lodash's interface and behavior
  • 🎯 Type Safety: Written in TypeScript with complete type definitions
  • 📦 Subpath Imports: Granular imports for minimal bundle size
  • 🧪 Test Coverage: Every function has test cases that match Lodash's behavior exactly
  • 0️⃣ Zero Dependencies: No external runtime dependencies, keeping your bundle lean
  • Proven Reliability: Used in production at NAVER Pay

Installation

npm install @naverpay/hidash
# or
yarn add @naverpay/hidash
# or
pnpm add @naverpay/hidash

Usage

Import functions individually using subpath imports:

import has from '@naverpay/hidash/has'
import isEmpty from '@naverpay/hidash/isEmpty'
import isObject from '@naverpay/hidash/isObject'

// Same interface as Lodash
has(object, 'user.name') // true
isEmpty([]) // true
isObject({}) // true

❌ Package does not support namespace imports:

// This will not work
import {has, isEmpty} from '@naverpay/hidash'

Why hidash?

  • Modern: Built specifically for subpath imports for optimal tree-shaking
  • Performance: Optimized implementations that outperform Lodash in most scenarios
  • Compatibility: Designed as a drop-in replacement with identical interfaces and behavior
  • Tested: Comprehensive test suite ensuring Lodash compatibility and performance benchmarks

Benchmarks (2024.11.04)

✓ src/isEmpty.bench.ts (2) 1323ms
  ✓ isEmpty performance (2) 1322ms
    · hidash   324.23 ops/sec ±0.40% (0 samples) fastest
    · lodash  35.6400 ops/sec ±0.42% (0 samples)
✓ src/keys.bench.ts (2) 3031ms
  ✓ keys performance (2) 3030ms
    · hidash  27.6429 ops/sec ±0.38% (0 samples) fastest
    · lodash   7.5177 ops/sec ±0.47% (0 samples)
✓ src/size.bench.ts (2) 1265ms
  ✓ size performance (2) 1263ms
    · hidash  119.83 ops/sec ±1.05% (0 samples) fastest
    · lodash  114.94 ops/sec ±1.65% (0 samples)


BENCH  Summary

 hidash - src/isEmpty.bench.ts > isEmpty performance
   9.10x faster than lodash

 hidash - src/keys.bench.ts > keys performance
   3.68x faster than lodash

 hidash - src/size.bench.ts > size performance
   1.04x faster than lodash

Available Functions

Type Checks

@naverpay/hidash/isArray    // Check if value is an Array
@naverpay/hidash/isEmpty    // Check if value is empty
@naverpay/hidash/isNil      // Check if value is null or undefined
@naverpay/hidash/isObject   // Check if value is an Object

Object Operations

@naverpay/hidash/has        // Check if path exists in object
@naverpay/hidash/keys       // Get object keys
@naverpay/hidash/size       // Get collection size

API Reference

Type Checks

@naverpay/hidash/isArray

function isArray(value: unknown): value is Array<unknown>

Returns true if value is an array, else false.

@naverpay/hidash/isEmpty

function isEmpty(value: unknown): boolean

Returns true if value is empty, else false. Arrays, strings, or objects with no properties are considered empty.

@naverpay/hidash/isNil

function isNil(value: unknown): value is null | undefined

Returns true if value is null or undefined, else false.

@naverpay/hidash/isObject

function isObject(value: unknown): boolean

Returns true if value is an Object, else false.

Object Operations

@naverpay/hidash/has

function has(object: unknown, path: string | ReadonlyArray<string>): boolean

Checks if path is a direct property of object.

@naverpay/hidash/keys

function keys(object: unknown): string[]

Returns an array of object's enumerable property names.

@naverpay/hidash/size

function size(collection: unknown): number

Gets the size of collection by returning its length for array-like values or the number of enumerable properties for objects.

Contributing

Contributions are welcome!

Feature Requests

Want additional Lodash methods to be implemented? Please create an issue with:

  • The method name
  • Use case description
  • Current workaround (if any)

We prioritize implementing new methods based on community needs.

Pull Requests

Feel free to submit PRs for:

  • Bug fixes
  • Performance improvements
  • New utility methods
  • Documentation improvements

Please read our contributing guidelines before submitting PRs.

Benchmarks

Performance comparison with Lodash using Vitest:

pnpm run bench

Test Coverage

All functions are tested for compatibility with Lodash behavior:

pnpm run test

License

MIT License - see the LICENSE.md file for details.


Made with ❤️ by NAVER Pay frontend team.