0.0.3 • Published 9 years ago
the-typist v0.0.3
The Typist
Like a typewriter, split a string into lines or characters and pass each piece to a callback with a delay.
Installation
Via npm:
```bash
npm install the-typist
```
Usage
var typist = require('the-typist'),
str = 'Some long string';
var promise = typist(str, {
callback: function(t){log(t);}, // which function to pass pieces to
delay: 100, // ms delay between pieces
mode: 'char', // type by line or char
lineDelay: 200, // if set to "char", delay controls delays between chars,
// while lineDelay controls delay between lines
useStdout: true, // whether to write each piece to stdout
trailingNewLine: true // add a trailing new line to end of output
});
promise.then(function(){
// we're all done.
}).done();
### Testing
```bash
cd the-typist
mocha
Testing depends on: