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

imito

v1.0.2

Published

copy and transform primitives and single or multiple objects

Downloads

8

Readme

OPEN open source software

imito

NOTE: Currently the eventual structure of the API of this module is being experimented on so please don't rely on it remaining the same from version to version until further note. This also explains the current absense of examples. Hopefully I will nail down enough of this shortly so I'll be able to provide more documentation.

This module will eventually provide functionality for transforming primitives and objects into other objects or primitivs while duplicating them. There are many targeted use cases, so here are some common examples:

  • deep copy - duplicate the entire object
  • mixed copy - duplicate the object while leaving some references pointing to the same sub object as the original
  • deep compare - transform two or more objects (i.e. one array of two or more objects) into a boolean value (true if the objects are the same, false otherwise)
  • remove circular references - duplicate the entire object while replacing circular reference with other values
  • unhide hidden properties - transform an object into one with all the hidden properties unhidden.
  • generate HTML from an object - transform an object into a string containing valid HTML
  • transform XML string into an object

There are many more uses, but importantly imito will support easy customization of these transformations. Transformation configurations can be chained so you only need to specify a changed behavior, not the entire transformation. Thus you can start with a plain "deep copy" transformation and then specify that a property .some.other should be changed to some other value. You can also use chaining to "compose" transformations. For instance, if you have one transformation that can create an object out of XML and another that can convert an object to HTML then you can chain them together to generate HTML from XML. A number of predefined transformations will be provided so you can use them by name rather than having to specify the full syntax. Additionally, you can "register" new custom transformations (including any chanined ones) so that you can refer to them by name as well.