# configdir
> Return a directory for user-specific configuration files.
## Usage
```javascript
var configdir = require( '@stdlib/os/configdir' );
```
#### configdir( \[path] )
Returns a directory for user-specific configuration files.
```javascript
var dir = configdir();
// e.g., returns '/Users//Library/Preferences'
```
To append a `path` to the base directory, provide a `path` argument.
```javascript
var dir = configdir( 'appname/config' );
// e.g., returns '/Users//Library/Preferences/appname/config'
```
On non-Windows platforms, if the function is unable to locate the current user's [`home`][@stdlib/os/homedir] directory, the function returns `null`. Similarly, on Windows platforms, if the function is unable to locate an application data directory, the function also returns `null`.
## Notes
- On Windows platforms, the function first checks for a `LOCALAPPDATA` [environment variable][environment-variable-windows] before checking for an `APPDATA` [environment variable][environment-variable-windows]. This means that machine specific user configuration files have precedence over roaming user configuration files.
## Examples
```javascript
var configdir = require( '@stdlib/os/configdir' );
console.log( configdir( 'appy/config' ) );
```
* * *
## CLI
### Usage
```text
Usage: configdir [options]
Options:
-h, --help Print this message.
-V, --version Print the package version.
```
### Examples
```bash
$ configdir
e.g., /Users//Library/Preferences
```
[environment-variable-windows]: https://en.wikipedia.org/wiki/Environment_variable#Windows
[@stdlib/os/homedir]: https://www.npmjs.com/package/@stdlib/os/tree/main/homedir