# default-shell

> Get the user's default shell

Latest version **2.2.0** (published 2021-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install default-shell
pnpm add default-shell
yarn add default-shell
bun add default-shell
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2021-09-17 |
| First published | 2016-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 43 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | default, shell, sh, zsh, bash, cmd, comspec, env, environment, variables, get, user |

## Links

- npm: https://www.npmjs.com/package/default-shell
- Repository: https://github.com/sindresorhus/default-shell
- Homepage: https://github.com/sindresorhus/default-shell#readme
- Issues: https://github.com/sindresorhus/default-shell/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/default-shell

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 2.2.0 (latest) — 2021-09-17
- 2.1.0 — 2021-09-16
- 2.0.0 — 2021-08-24
- 1.0.1 — 2016-05-02
- 1.0.0 — 2016-01-23

## README

# default-shell

> Get the user's default [shell](https://en.wikipedia.org/wiki/Shell_(computing))

## Install

```sh
npm install default-shell
```

## Usage

```js
import defaultShell from 'default-shell';

// macOS
console.log(defaultShell);
//=> '/bin/bash'

// Windows
console.log(defaultShell);
//=> 'C:\\WINDOWS\\system32\\cmd.exe'
```

There is also a method that gets the correct default shell even if it changes at runtime:

```js
import {detectDefaultShell} from 'default-shell';

console.log(detectDefaultShell());
//=> '/bin/bash'
```

---
_Source: https://npm.io/package/default-shell · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
