@dawsonbotsford/shell-history

Get the command history of the user's shell

Usage no npm install needed!

<script type="module">
  import dawsonbotsfordShellHistory from 'https://cdn.skypack.dev/@dawsonbotsford/shell-history';
</script>

README

@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