Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

default-shell

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

default-shell - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

23

index.js

@@ -1,8 +0,6 @@

'use strict';
module.exports = (() => {
const env = process.env;
import process from 'node:process';
import {userInfo} from 'node:os';
if (process.platform === 'darwin') {
return env.SHELL || '/bin/bash';
}
const defaultShell = (() => {
const {env} = process;

@@ -13,3 +11,16 @@ if (process.platform === 'win32') {

try {
const {shell} = userInfo();
if (shell) {
return shell;
}
} catch {}
if (process.platform === 'darwin') {
return env.SHELL || '/bin/zsh';
}
return env.SHELL || '/bin/sh';
})();
export default defaultShell;
{
"name": "default-shell",
"version": "1.0.1",
"description": "Get the user's default shell",
"license": "MIT",
"repository": "sindresorhus/default-shell",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"default",
"shell",
"sh",
"zsh",
"bash",
"cmd",
"cmd.exe",
"comspec",
"env",
"environment",
"var",
"variables",
"get",
"user"
],
"devDependencies": {
"ava": "*",
"xo": "*"
},
"xo": {
"esnext": true
}
"name": "default-shell",
"version": "2.0.0",
"description": "Get the user's default shell",
"license": "MIT",
"repository": "sindresorhus/default-shell",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"default",
"shell",
"sh",
"zsh",
"bash",
"cmd",
"comspec",
"env",
"environment",
"variables",
"get",
"user"
],
"devDependencies": {
"ava": "^3.15.0",
"xo": "^0.44.0"
}
}

@@ -1,6 +0,5 @@

# default-shell [![Build Status](https://travis-ci.org/sindresorhus/default-shell.svg?branch=master)](https://travis-ci.org/sindresorhus/default-shell)
# default-shell
> Get the user's default [shell](https://en.wikipedia.org/wiki/Shell_(computing))
## Install

@@ -12,9 +11,8 @@

## Usage
```js
const defaultShell = require('default-shell');
import defaultShell from 'default-shell';
// OS X
// macOS
console.log(defaultShell);

@@ -27,6 +25,1 @@ //=> '/bin/bash'

```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc