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 🙏

© 2025 – Pkg Stats / Ryan Hefner

turtledash

v1.0.2

Published

Tiny, efficient, TypeScript utility functions inspired by Lodash.

Downloads

14

Readme

turtledash

Tiny, efficient, TypeScript utility functions inspired by Lodash.

Installation

npm install turtledash

Features

turtledash provides a collection of utility functions for working with objects, arrays, and more:

  • Lightweight implementation of common utility functions
  • Fully typed with TypeScript
  • Zero dependencies
  • MIT licensed

API Reference

Object Functions

mapValues<T, U>(obj, fn, [o])

Maps the values of an object to create a new object with the same keys.

const users = { 'fred': { 'age': 40 }, 'pebbles': { 'age': 1 } };
mapValues(users, user => user.age); // { 'fred': 40, 'pebbles': 1 }

mapObject<T, U>(obj, fn)

Maps an object's entries and returns a new object.

pick<T, K>(o, props)

Creates an object composed of the picked object properties.

pickWhere<T>(o, where)

Creates an object with properties that satisfy the provided predicate function.

omit<T, K>(o, props)

Creates an object composed of properties not included in the provided array.

cloneDeep<T>(obj)

Creates a deep clone of the value.

merge<T, U>(obj, src)

Recursively merges own properties of the source object into the target object.

get<T, K>(obj, path, defaultValue)

Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned.

Array Functions

choose<T>(array, indices)

Creates an array of elements selected from the original array at the specified indices.

flatten<T>(arr)

Flattens an array a single level deep.

zip<T>(...arr)

Creates an array of grouped elements.

uniq<T>(array)

Creates an array of unique values.

union<T>(...arrays)

Creates an array of unique values from all given arrays.

intersection<T>(a1, ...arrays)

Creates an array of unique values that are included in all given arrays.

difference<T>(a1, ...arrays)

Creates an array of values from the first array that are not included in the other arrays.

Other Utility Functions

delay(msec)

Returns a Promise that resolves after the specified number of milliseconds.

randomBytes(length)

Generates cryptographically strong random bytes.

randomHexString(length)

Generates a random hex string.

normalizeString(str)

Normalizes strings by replacing punctuation marks and applying unicode normalization.

randomIntFromRange(min, max)

Generates a random integer between min and max, inclusive.

randomFromArray<T>(arr)

Returns a random element from an array.

linearScale([d1, d2], [r1, r2])

Creates a function that linearly scales a value from one range to another.

deepEqualJSONType(a, b)

Performs a deep equality check on JSON-compatible objects.

hashableRepresentation(unsorted)

Creates a consistently sortable representation of an object for hashing purposes.

debounce<A, R, C>(func, wait, immediate)

Creates a debounced function that delays invoking the provided function.

throttle<A, R>(func, delay)

Creates a throttled function that only invokes the provided function at most once per specified interval.

Examples

import { 
  mapValues, 
  pick, 
  debounce, 
  randomIntFromRange 
} from 'turtledash';

// Transform all values in an object
const users = { 'fred': { 'age': 40 }, 'pebbles': { 'age': 1 } };
const ages = mapValues(users, user => user.age);
// { 'fred': 40, 'pebbles': 1 }

// Pick specific properties from an object
const user = { id: 1, name: 'John', email: 'john@example.com', role: 'admin' };
const credentials = pick(user, ['name', 'email']);
// { name: 'John', email: 'john@example.com' }

// Create a debounced function
const saveChanges = debounce(() => {
  // Save data to server
  console.log('Saving changes...');
}, 500);

// Generate a random number in a range
const randomValue = randomIntFromRange(1, 100);

License

MIT License