2.0.0 • Published 7 years ago

@dawsonbotsford/shell-history v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

@dawsonbotsford/shell-history Build Status

Get the command history of the user's shell

Hard fork of SindreSorhus' shell-history

Install

$ npm install --save shell-history

Usage

const shellHistory = require('shell-history');

console.log(shellHistory());
//=> ['ava', 'echo unicorn', 'node', 'npm test', ...]

API

shellHistory()

Get an array of commands.

On Windows it will always be an empty array as command history is not persisted there.

shellHistory.getContent()

Get the Contents of the first occurring history file in the list of files

shellHistory.parse(string)

Parse a shell history string into an array of commands.

License

MIT © Dawson Botsford