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

readline-history

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 30 Aug 2013

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc