ASCII Frames
Create ASCII animations in Terminal using ASCII frames.
Methods
loadFrames (options)
The options
parameter is an array of strings representing the frames.
In the future it will can be an object.
startAnimation (options)
The options
parameter is an object containing the following fields:
frameDelay
: (number) the delay in milisecondsrepeat
: (boolean) repeat animation after end
Example
// framesvar frames = "╔════╤╤╤╤════╗\n" + "║ │││ \\ ║\n" + "║ │││ O ║\n" + "║ OOO ║" "╔════╤╤╤╤════╗\n" + "║ ││││ ║\n" + "║ ││││ ║\n" + "║ OOOO ║" "╔════╤╤╤╤════╗\n" + "║ / │││ ║\n" + "║ O │││ ║\n" + "║ OOO ║" "╔════╤╤╤╤════╗\n" + "║ ││││ ║\n" + "║ ││││ ║\n" + "║ OOOO ║" // require the library AsciiFrames = // create a new instance animation = ; // load framesanimation; // and start animationanimation;
How to test
$ npm install ascii-frames$ cd node_modules$ npm test
Changelog
v0.2.0
- Use
process.stdout
instead ofconsole.log
.
v0.1.2
- Fixed the condition for animation end when repeat is not
true
v0.1.0
- Initial release
License
See the LICENSE file.