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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fast-prop-del

v1.0.6

Published

Remove/Add one or several object properties returning an object with fast properties.

Readme

fast-prop-del

Fast property delete.

With this library you can delete object properties and then turn the object to fast property mode. Aditionally, you can turn common objects to fast property mode or add new properties to an object forcing the object to be fast property mode.

In v8 engine an object has two ways of representation:

  • Dictionary mode (also known as normalized objects)
  • Fast property mode

How do I know if an object is Dictionary or Fast property mode?

When you use your object as if it was a hash table your object may turn to dictionary mode. For example, when you add several properties dinamically or when you delete a property.

This makes the object have worse performance when you access an object property.

You can learn more:

You can try the performance using as example performance.js

  • Iterate dictionary: 57ms
  • Iterate fastProp: 9ms

6 times faster!


Install

$ npm install fast-prop-del

Test

$ npm install
$ npm test

Check performance

$ npm install
$ node --allow-natives-syntax test/performance.js

Usage

Remove property

var propDel = require('fast-prop-del').propDel;

var obj = {'bar': 'foo'};
propDel(obj, 'bar');
console.info(obj);
// obj => {}

var obj = {
  'bar': {
    'foo': 'bar'
  }
};
propDel(obj.bar, 'foo');
console.info(obj);
// obj => {'bar': null}

propDel(null, 'foo');
// Error => Invalid object

Remove several properties

var propDel = require('fast-prop-del').propDel;

var obj = {
  'a': 'a',
  'b': 'b',
  'c': 'c',
  'd': 'd'
};
propDel(obj, ['a','b','c']);
console.info(obj);
// obj => {'d': 'd'}

var obj = {
  'a': 'a',
  'b': 'b',
  'c': 'c',
  'd': 'd'
};
propDel(obj, Object.keys(obj));
console.info(obj);
// obj => {}

Turn object into fast properties mode

var turnToFastProp = require('fast-prop-del').turnToFastProp;

var obj = {'bar': 'foo'};
delete obj.bar;
turnToFastProp(obj);

Adding one property to an object turning the object into fast properties mode

var propAdd = require('fast-prop-del').propAdd;

var obj = {'bar': 'foo'};
propAdd(obj, 'bar2', 'foo2');
console.info(obj);
// obj => {'bar': 'foo', 'bar2': 'foo2'}

Adding several properties to an object turning the object into fast properties mode

var propAdd = require('fast-prop-del').propAdd;

var obj = {'bar': 'foo'};
var objToMix = {
  'a': 'a',
  'b': 'b'
};
propAdd(obj, objToMix);
console.info(obj);
// obj => {'bar': 'foo', 'a': 'a', 'b': 'b'}