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

icepath

v0.0.15

Published

Utilities for treating frozen JavaScript objects as persistent immutable collections.

Downloads

62

Readme

icepath Build Status via Travis CI NPM version Coverage Status

Utilities for treating frozen JavaScript objects as persistent immutable collections.

Motivation

icepath provides functions that allow you to "modify" a structure by returning a partial clone using structural sharing. Only collections in the structure that had a child change will be changed.

icepath uses structural sharing at the object or array level. icepath does not use tries to store objects or arrays, so updates will be less efficient. This is to maintain JavaScript interoperability at all times. Also, for smaller collections, the overhead of creating and managing a trie structure is slower than simply cloning the entire collection. However, using very large collections (e.g.collections with more than 1000 elements) with icepath could lead to performance problems.

Structural sharing is useful wherever you can avoid expensive computation if you can quickly detect if the source data has changed. For example, shouldComponentUpdate in a React component. If you are using a frozen hierarchical object to build a system of React components, you can be confident that a component doesn't need to update if its current props strictly equal the nextProps.

API

  • set
  • unset
  • assoc
  • get
  • update
  • chain
  • single
For Arrays:
  • push pushIn
  • unshift unshiftIn
  • pop popIn
  • shift shiftIn
  • reverse reverseIn
  • sort sortIn
  • splice spliceIn
  • slice sliceIn
  • map mapIn
  • filter filterIn
For Objects:
  • assign assignIn
  • map mapIn
  • filter filterIn

License

MIT