Socket
Socket
Sign inDemoInstall

readline-history

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    readline-history

Adds support for saving history to a file, and loading it next time automatically.


Version published
Weekly downloads
122
decreased by-61.64%
Maintainers
1
Install size
5.64 kB
Created
Weekly downloads
 

Readme

Source

/* Monkey-patching history support into readline.

  • Usage: createInterface is like readline's createInterface, but also takes a path and
  • a maximum (in-memory) history length. Also it's async, so use CPS.
  • maxDiskSize is maximum bytes that can go in disk history
  • before a rotation. Rotation is super simple, removes previous .old, renames to .old
  • console.log(module.example) to see an example of how to use. */

var rl = require('readline-history'); rl.createInterface({ path: "/tmp/history", maxLength: 1234, input: process.input, output: process.output, next: function(rli) { rli.setPrompt("? "); rli.prompt(); rli.on('line',function(line) { console.log("Got line "+line); rli.prompt(); }); }; });

FAQs

Last updated on 30 Aug 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc