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

config-tea

v1.0.2

Published

The application configuration plugin project for console application.

Downloads

14

Readme

#Configuration Tea

This is a server-side configuration plugin which is similar to the NET project application configuration. it is aimed at providing a convenient configuration management based on XML file. Of course, we have provided the extend interface for you to support other configuration based on other media like JSON file.

Git Repository

##Installation npm install config-tea

##Usage

  1. ###Basic

    • create a xml-based configuration file.

        <?xml version="1.0" encoding="utf-8"?>
        <Configuration>
        	    <Sections>
        	        <Section name='AppSettings' provider='./lib/appSettingSectionHandler'/>
        	    </Sections>
        	    <Databases>
        	        <Database name='local' connectionString='Data Source=.;Initial Catalog=Test;Integrated Security=true;'/>
        	    </Databases>
        	    <AppSettings>
        	        <add key="NODE_ENV" value="uat"/>
        	    </AppSettings>
        </Configuration>
    • add package reference in your application main class.

        var manager=require('config-tea').ConfigurationManager;
    • load and init configuration with the below code.

        manager.init();
  2. ###Custom

    The custom usage is about custom configuration for some special application like log4js. you can define the custom section handler to load the configuration information and then initialize the anything based on the configuration information.

    • Add the custom XML nodes in the configuration file.

        <Custom>
            	<add key="test" value="world"/>
         </Custom>
    • Define your custom section handler.

        var util=require('util');
        var configuration=require('../../index');
      		
        var sectionHandler=configuration.SectionHandler;
      		
        function customHandler(){
      		
        }
      		
        util.inherits(customHandler, sectionHandler);
      		
        customHandler.prototype.getSectionName=function(){
            return 'Custom';
        };
      		
        customHandler.prototype.parseSection=function(parser,ctx){
            var result={
      		
            };
            if(parser){
                //to parser the XML data.
            }
            return result;
        };
      		
        customHandler.prototype.process=function(entity, ctx){
            var appConfig=ctx.getAppConfiguration();
            appConfig.custom=entity;
        };
      		
        module.exports=new customHandler();
    • Register your custom section handler in the configuration file.

        <Sections>
             <Section name='Custom' provider='./customHandler'/>
         </Sections>
    • Load and init the configuration like the basic usage.

    ####examples:

    1. custom handler
    2. log handler
  3. ###Runtime

    The runtime configuration is the built-in configuration. it will change and update the process.env by your configuration in file.

    for example:

     <Runtime>
          <add key="NODE_ENV" value="production"/>
     </Runtime>			

##Reference

  1. ConfigurationManager

    ConfigurationManager is the manager class for configuration operation. it will provide the basic operation options for configuration.

    • init() - load and init configuration based on configuration file.
    • initFromFile(filePath) - load and init configuration based on a pointed configuration file.
    • initFromReader(reader) - load and init configuration based on configuration reader.
    • getAppConfig() - get the initialized configuration information.
    • getDatabases() - get the database relative configuration information. The database is the built-in configuration.
    • getAppSettings() - get the application settings configuration information. The appSettings is the built-in configuration.
  2. ConfigurationReader

    ConfigurationReader is the interface which is used to provide the basic template for custom media data reader like JSON.

  3. SectionHandler

    SectionHandler is the interface which is used to provide the basic template for custom configuration handler.

##Author

Iven Yin

email: [email protected]