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

@visulima/object

v1.0.6

Published

Helper functions for working with objects and arrays.

Downloads

14

Readme

is-plain-obj, dot-prop, deeks and type-fest

typescript-image npm-image license-image



Install

npm install @visulima/object
yarn add @visulima/object
pnpm add @visulima/object

Usage

deleteProperty

escapePath

getProperty

hasProperty

setProperty

deepKeys

deepKeysFromList

isPlainObject

pick

With pick you pass an object and an array of keys of an object - the props which may stay.

import { pick } from "@visulima/object";

const squirtle = { id: "007", name: "Squirtle", type: "water" };

const newObject = pick(squirtle, ["name", "type"]);
// returns { name: 'Squirtle', type: 'water' }

const doc = { items: { keep: "📌", discard: "✂️" } };

pick(doc, ["items.keep"]);
// returns {items: {keep: '📌'}}

omit

With omit you pass an object and an array of keys of an object - the props which should be removed.

import { omit } from "@visulima/object";

const squirtle = { id: "007", name: "Squirtle", type: "water" };

const withoutId = omit(squirtle, ["id"]);
// returns { name: 'Squirtle', type: 'water' }

const doc = { items: { keep: "📌", discard: "✂️" } };

omit(doc, ["items.discard"]);
// returns {items: {keep: '📌'}}

Related

  • is-plain-object - Returns true if the given value is an object created by the Object constructor.
  • is-plain-obj - Check if a value is a plain object.
  • dot-prop - Get, set, or delete a property from a nested object using a dot path.
  • ts-dot-prop - TypeScript utility to transform nested objects using a dot notation path.
  • dset - A tiny (194B) utility for safely writing deep Object values~!
  • filter-anything - A simple (TypeScript) integration of "pick" and "omit" to filter props of an object.

Supported Node.js Versions

Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.

Contributing

If you would like to help take a look at the list of issues and check our Contributing guidelines.

Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits

License

The visulima object is open-sourced software licensed under the MIT