@cjser/shell-history
v2.0.1-cjser.2
Published
Get the command history of the user's shell
Downloads
22
Maintainers
Readme
shell-history
Get the command history of the user's shell
Install
npm install shell-historyUsage
import {shellHistory, shellHistoryPath} from 'shell-history';
console.log(shellHistory());
//=> ['ava', 'echo unicorn', 'node', 'npm test', …]
console.log(shellHistoryPath());
//=> '/Users/sindresorhus/.history'API
shellHistory()
Get an array of commands.
On Windows, unless the HISTFILE environment variable is set, this will only return commands from the current session.
shellHistoryPath()
Get the path of the file containing the shell history.
On Windows, this will return either the HISTFILE environment variable or undefined.
parseShellHistory(string)
Parse a shell history string into an array of commands.
Related
- shell-path - Get the $PATH from the shell
- shell-env - Get environment variables from the shell
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/shell-history
