node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »



Textlogin is a module that allows you to do the following

  • Collect a username, password, and any other fields you want in style!
  • Make ansi based menus

Example (login)

var textlogin = require('textlogin')('form');
    .title("Beep Boop Industries")
    .success(function(response) {
        // response == {username:<entered username>, password:<entered password>}

Example (menu)

var textlogin = require('textlogin')('menu');
    .title("Blitzster's Restaurant Menu")
    .add({value:'Oily Grog $1.00'})
    .add({value:'Boop Burger $3.50'})
    .add({value:'French Fries $0.50'})
    .success(function(response) {
        // response = {value:<item selected>}



Sets the title name

.add({key:<key>, value: <initial value>, display:<hidden|hidden_ascii>})

Adds a field named <key> with initial value <initial value>. Display field is optional and can be one of the following two: hidden or hidden_ascii. Use hidden_ascii if you want a simple '*' for your display value.


Callback will be called after all keys have their associated values filled in. The callback will be passed a response object like so:



Optionally, you can pass an event emitter to .notify. It will emit 'done' when it is done, and pass the same response object as .success. You can use either the success callback or the notify event, or both, or none.


Call start to start collection.


Execute any success callbacks (that were assigned with .success) or emit any notifications (that were assigned with .notfiy). Also erase all values in parameters set with .add.


Call this when you are completely finished with the interface.