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

file-config-reader

v0.1.1

Published

A simple module for loading/merging local and global JSON configuration files.

Downloads

5

Readme

file-config-reader

A simple module for reading and merging config files that are stored "locally" (current working tree) and "globally" (home directory).

This module was built primarily for use when writing command-line (CLI) programs in Node.js. It implements some features from a few of my favorite command-line applications:

  • JSHint - looks for config files not just in the working directory, but also in parent directory.
  • Git - looks for config files in both a "local" and "global" location.

Instead of passing options to the command-line, it's often beneficial to store program-specific options in a configuration file. Additionally, you may want to maintain project-specific configuration files and/or a global configuration file for shared cross-project settings (i.e. 'git'). Also, when working within subdirectories of a project folder, it's often useful for a command-line utility to search upwards in the directory tree for a configuration file, so you don't constantly need to navigate back to the location of the configuration file (i.e. JSHint).

Note: Currently, this module only supports files with JSON content.

Install

npm install file-config-reader --save

Usage

> pwd
/Users/andre/dev/projects/cli_reader

> cat conf.json
{
  "projectName": "cli_reader_sample",
  "email": "[email protected]"
}

> cat $HOME/conf.json
{
  "firstName": "Andre",
  "lastName": "Giannico",
  "email": "[email protected]",
  age: 31
}
var FileConfigReader = require('file-config-reader');

var conf = new FileConfigReader('conf.json');

console.log(conf.firstName);

// output
"Andre"

console.log(conf);

// output
{
  projectName: "cli_reader_sample",
  firstName: "Andre",
  lastName: "Giannico",
  email: "[email protected]",
  age: 31
}

License

Copyright 2014 Andre Giannico MIT License (enclosed)