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

combine-config

v1.0.2

Published

combine config

Readme

combine-config

Combine config object

Install

npm install combine-config

Usage

var combine_config = require("combine-config");
var prototype_stringify = require("prototype-stringify");   //tool for debug

var base_config = {
	ip: "127.0.0.1",	//Items will be untouched if not existed in sub config.
	port: 8080,
	param: [1, 2, 3, 4],
	date1: new Date(2000, 1, 1),
	func1: function () { },

	mine: {
		"html": "text/html",	//Items will be untouched if not existed in sub config.
		"jpg": "image/jpg",
	},
	mine2: {
		"html": "text/html",
		"jpg": "image/jpg",
	},

};

var sub_config = {
	port: 8081,		//Items will be replaced, except simple objects.
	param: [3, 4],
	date1: null,
	func1: undefined,

	mine: {				//simple objects will be deep-copied.
		"txt": "text/plain",
		"jpg": "application/octet-stream",
	},
	"!mine2": {			//To stop deep-copy, prefix name with "!".
		"txt": "text/plain",
	},

	param2: "new param",	//Add new item
};

var new_config = combine_config(base_config, sub_config, "test");		//A new config object is created

//change somethig
new_config.mine["css"] = "text/css";		//The base config is isolated by prototype chain

base_config.ip2 = "127.0.0.2";			//Change to base config will be seen in the new config
base_config.mine["js"] = "text/javascript";
base_config.mine["html"] = "text";

console.log(new_config);
prototype_stringify(new_config, "\t");

/*
var expect_config = {
	ip: "127.0.0.1",
	ip2: "127.0.0.2",
	port: 8081,
	param: [3, 4],
	date1: null,
	func1: undefined,

	mine: {
		"html": "text",
		"txt": "text/plain",
		"jpg": "application/octet-stream",
		"js": "text/javascript",
		"css": "text/css",
	},
	mine2: {
		"txt": "text/plain",
	},
	param2: "new param",
};
*/