Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
handle module specific configurations in their own directory
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.foo
LICENSE.mkd
README.mkd
confdir.js
package.json
test.js

README.mkd

confdir

handle module specific configurations in their own directory

Installation

npm install confdir or npm install -g confdir

Usage

For example anywhere in a Git repository you could get a reference to the .git directory:

var confdir = require('confdir');

confdir(__dirname, 'git', function (err, dir) {
  if (err)
    console.log(err);
  else
    console.log("The Git files are in " + dir);
});

This would print an absolute reference to the .git directory.


confdir is only one method:

confdir(dir, name, callback)

where

  • dir is a reference to a directory, that will be walked up,
  • name is the name of the configuration directory (without the dot) and
  • callback is a callback function that takes two arguments (err, dir).

Bugs and Issues

If you encounter any bugs or issues, feel free to open an issue at github.

License

This package is licensed under the MIT license.

Something went wrong with that request. Please try again.