Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pvorb/node-confdir
handle module specific configurations in their own directory
https://github.com/pvorb/node-confdir
Last synced: about 1 month ago
JSON representation
handle module specific configurations in their own directory
- Host: GitHub
- URL: https://github.com/pvorb/node-confdir
- Owner: pvorb
- License: mit
- Created: 2011-12-22T02:20:49.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2011-12-23T04:02:22.000Z (almost 13 years ago)
- Last Synced: 2024-04-14T09:53:36.552Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 122 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkd
- License: LICENSE.mkd
Awesome Lists containing this project
README
# 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:``` js
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](//github.com/pvorb/node-confdir/issues).## License
This package is licensed under the
[MIT license](http://vorb.de/license/mit.html).