1.0.0 • Published 10 years ago

ascii-dance v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

ascii-dance

¯\_(ツ)_/¯ _/¯(ツ)¯\_ ¯\_(ツ)¯\_ _/¯(ツ)_/¯

Generate strings of any ascii people dancing in Node.js and the browser.

Based on kirby-dance by Nizar Khalife Iglesias.

Example

var dancer = require('ascii-dance'),
    shruggieDance = dancer([[
      "¯\\_(ツ)_/¯",
      "_/¯(ツ)¯\\_",
      "¯\\_(ツ)¯\\_",
      "_/¯(ツ)_/¯"
    ]]);

console.log(shruggieDance(4)); // "¯\_(ツ)_/¯ _/¯(ツ)¯\_ ¯\_(ツ)¯\_ _/¯(ツ)_/¯"

console.log(shruggieDance(-7)); // "_/¯(ツ)_/¯ ¯\_(ツ)¯\_ _/¯(ツ)¯\_ ¯\_(ツ)_/¯ _/¯(ツ)_/¯ ¯\_(ツ)¯\_ _/¯(ツ)¯\_"

API

dancer(moves)

Returns a functon that will generate dances, where moves is an array of one or more strings.

The returned dance is a function dance(n), which will return a string of n dance moves, where n is an integer. If n is negative, it reverses the dance (starting from the last move).

License

ISC