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

objects-mixing

v0.0.1

Published

This module is for mixing an objects in one super object.It uses __proto__ property to combine objects, but not just copying properties and methods.

Downloads

2

Readme

**

**

Object mixing module.

**

** This module is for mixing an objects in one super object. It uses proto property to combine objects, but not just copying properties and methods. require of this module returns function(arg). This module extends a standard Object by the method addMixin().

NOTE! In this version of the module you can't to mix objects, that are instances of the same objects

A. function(arg) - arg is a number of arguments:

  1. arrays - [constructor(, arguments, this)], where constructor is function, object constructor, arguments - array of arguments for function-constructor this - uses as this in function-constructor each of constructor creates an object by using arguments and this;
  2. objects - object;

Then all of objects, created by constructor, or passed as an argument, will be joined in one super-object, that contain all of the methods and properties of all objects. To use this module in your application you need to require("object-mixing") then use it as function(arg), for example: var objMixingFunc = require("object-mixing")(new Obj1,[constructor, arguments]);

B. addMixin() = function(arg) (see A.).

You can use addMixin() with any object in your app. For example obj1.addMixin(obj2) - and all the methods and properties of obj2 will be available through obj1.


Example of A. use-case:

var objMixingFunc = require("objects-mixing");
function cr1(myName)
{
    this.name = myName;
}
function cr2(myLastname)
{
    this.lastname = myLastname;
}
function cr3()
{
    this.sayMe = function(){
        console.log(this.name);
    };
}
function cr4()
{
    this.gggg="33";
    };
function cr5()
{
    this.Yes="88";
};
function crNext()
{
    this.func = "It works";
}
cr5();
cr1.prototype = new cr5();
cr3.prototype = new cr4();
cr2.prototype = new cr3();
var err22 = new Error("22");
var obj1 = objMixingFunc([cr1,"ME"],[cr2,"goodyTwo"],[crNext], [Error, "err", global]);
console.log(obj1);

Example of B. use-case:

var objMixingFunc = require("objects-mixing");
function objEx()
{
    this.prop1 = "objEx";
}
function objEx2()
{
    this.prop2 = "objEx2";
}
var obj1 = objMixingFunc(new Error("111"), [objEx]);
obj1.addMixin([objEx2]);