GithubHelp home page GithubHelp logo

lolcatjs's Introduction

lolcatjs

For when you need the lols but don't have the rubies.

This is a node port of the famous lolcat gem. It implements all the original functionality and behaviour.

Installation

npm install -g lolcatjs

Usage

Command Line

lolcatjs [OPTION]... [FILE]...

Concatenate FILE(s), or standard input, to standard output.
With no FILE, or when FILE is -, read standard input.

    --spread, -p <f>:   Rainbow spread (default: 8.0)
      --freq, -F <f>:   Rainbow frequency (default: 0.3)
      --seed, -S <i>:   Rainbow seed, 0 = random (default: 0)
       --animate, -a:   Enable psychedelics
  --duration, -d <i>:   Animation duration (default: 12)
     --speed, -s <f>:   Animation speed (default: 20.0)
         --force, -f:   Force color even when stdout is not a tty
       --version, -v:   Print version and exit
          --help, -h:   Show this message

Examples:
  lolcatjs f - g     Output f's contents, then stdin, then, g's contents.
  lolcatjs           Copy standard input to standard output.
  fortune | lolcatjs Display a rainbow cookie.

NPM Module

const lolcatjs = require('lolcatjs');

lolcatjs.options.seed = Math.round(Math.random() * 1000);
lolcatjs.options.colors = true;

lolcatjs.fromString('I can has Cheezburger?');

Demo

lolcatjs

Thanks

Nur Ortega Marsal for creating the banner

License

WTFPL Β© Robert Marsal

lolcatjs's People

Contributors

dependabot[bot] avatar dosentmatter avatar jbcpollak avatar mathieu-aubin avatar mr-beerkiss avatar rchougule avatar robertmarsal avatar scotttesler avatar shelldandy avatar vsa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lolcatjs's Issues

Compiler Errors on OSX Sierra

I just tried to install this and I got compiler errors:

npm install -g lolcatjs
/Users/jpollak/.nodenv/versions/6.2.1/bin/lolcatjs -> /Users/jpollak/.nodenv/versions/6.2.1/lib/node_modules/lolcatjs/cli.js

> [email protected] install /Users/jpollak/.nodenv/versions/6.2.1/lib/node_modules/lolcatjs/node_modules/sleep
> node-gyp rebuild

  CXX(target) Release/obj.target/node_sleep/sleep.o
../sleep.cc:36:3: error: use of undeclared identifier 'NanScope'
  NanScope();
  ^
../sleep.cc:38:7: error: use of undeclared identifier 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
      ^
../sleep.cc:38:29: error: use of undeclared identifier 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
                            ^
../sleep.cc:39:12: error: use of undeclared identifier 'NanThrowError'; did you mean 'Nan::ThrowError'?
    return NanThrowError("Expected number of seconds");
           ^~~~~~~~~~~~~
           Nan::ThrowError
../../nan/nan.h:659:3: note: 'Nan::ThrowError' declared here
  X(Error)
  ^
../../nan/nan.h:647:17: note: expanded from macro 'X'
    inline void Throw ## NAME(const char *msg) {                           \
                ^
<scratch space>:121:1: note: expanded from here
ThrowError
^
../sleep.cc:42:9: error: use of undeclared identifier 'args'
  sleep(args[0]->Uint32Value());
        ^
../sleep.cc:44:3: error: use of undeclared identifier 'NanReturnUndefined'
  NanReturnUndefined();
  ^
../sleep.cc:48:3: error: use of undeclared identifier 'NanScope'
  NanScope();
  ^
../sleep.cc:50:7: error: use of undeclared identifier 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
      ^
../sleep.cc:50:29: error: use of undeclared identifier 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
                            ^
../sleep.cc:51:12: error: use of undeclared identifier 'NanThrowError'; did you mean 'Nan::ThrowError'?
    return NanThrowError("Expected number of microseconds");
           ^~~~~~~~~~~~~
           Nan::ThrowError
../../nan/nan.h:659:3: note: 'Nan::ThrowError' declared here
  X(Error)
  ^
../../nan/nan.h:647:17: note: expanded from macro 'X'
    inline void Throw ## NAME(const char *msg) {                           \
                ^
<scratch space>:121:1: note: expanded from here
ThrowError
^
../sleep.cc:54:10: error: use of undeclared identifier 'args'
  usleep(args[0]->Uint32Value());
         ^
../sleep.cc:56:3: error: use of undeclared identifier 'NanReturnUndefined'
  NanReturnUndefined();
  ^
../sleep.cc:61:16: error: use of undeclared identifier 'NanNew'
  exports->Set(NanNew<String>("sleep"), NanNew<FunctionTemplate>(Sleep)->GetFunction());
               ^
../sleep.cc:61:23: error: 'String' does not refer to a value
  exports->Set(NanNew<String>("sleep"), NanNew<FunctionTemplate>(Sleep)->GetFunction());
                      ^
/Users/jpollak/.node-gyp/6.2.1/include/node/v8.h:2099:17: note: declared here
class V8_EXPORT String : public Name {
                ^
../sleep.cc:61:41: error: use of undeclared identifier 'NanNew'
  exports->Set(NanNew<String>("sleep"), NanNew<FunctionTemplate>(Sleep)->GetFunction());
                                        ^
../sleep.cc:61:48: error: 'FunctionTemplate' does not refer to a value
  exports->Set(NanNew<String>("sleep"), NanNew<FunctionTemplate>(Sleep)->GetFunction());
                                               ^
/Users/jpollak/.node-gyp/6.2.1/include/node/v8.h:4449:17: note: declared here
class V8_EXPORT FunctionTemplate : public Template {
                ^
../sleep.cc:61:72: error: member reference base type 'Nan::NAN_METHOD_RETURN_TYPE (Nan::NAN_METHOD_ARGS_TYPE)' (aka 'void (const FunctionCallbackInfo<v8::Value> &)') is not a structure or union
  exports->Set(NanNew<String>("sleep"), NanNew<FunctionTemplate>(Sleep)->GetFunction());
                                                                ~~~~~~~^ ~~~~~~~~~~~
../sleep.cc:62:16: error: use of undeclared identifier 'NanNew'
  exports->Set(NanNew<String>("usleep"), NanNew<FunctionTemplate>(USleep)->GetFunction());
               ^
../sleep.cc:62:23: error: 'String' does not refer to a value
  exports->Set(NanNew<String>("usleep"), NanNew<FunctionTemplate>(USleep)->GetFunction());
                      ^
/Users/jpollak/.node-gyp/6.2.1/include/node/v8.h:2099:17: note: declared here
class V8_EXPORT String : public Name {
                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/node_sleep/sleep.o] Error 1

weird coloring behavior?

using osx stock terminal

zsh

image

╭─kumavis@xyzs-MacBook-Pro  ~/dev/web3-provider-skeleton β€Ήnode-v0.12.7β€Ί  (master*) 
╰─$ fortune | cowsay | lolcatjs
 ______________________________________ 
/ QOTD:                                \
|                                      |
| "I drive my car quietly, for it goes |
\ without saying."                     /
 -------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

bash

image

╭─kumavis@xyzs-MacBook-Pro  ~/dev/web3-provider-skeleton β€Ήnode-v0.12.7β€Ί  (master*) 
╰─$ bash                       
bash-3.2$ fortune | cowsay | lolcatjs
 _________________________________________ 
/ Whatever women do they must do twice as \
| well as men to be thought half as good. |
| Luckily this is not difficult.          |
|                                         |
\ -- Charlotte Whitton                    /
 ----------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

install failure : (

╭─kumavis@xyzs-MacBook-Pro  ~/dev/web3-provider-skeleton β€Ήnode-v0.12.7β€Ί  (master*) 
╰─$ npm install -g lolcatjs                                                                                                                                                                             1 ↡
/Users/kumavis/.nvm/versions/node/v0.12.7/bin/lolcatjs -> /Users/kumavis/.nvm/versions/node/v0.12.7/lib/node_modules/lolcatjs/cli.js

> [email protected] install /Users/kumavis/.nvm/versions/node/v0.12.7/lib/node_modules/lolcatjs/node_modules/sleep
> node-gyp rebuild

  CXX(target) Release/obj.target/node_sleep/sleep.o
../sleep.cc:36:3: error: use of undeclared identifier 'NanScope'
  NanScope();
  ^
../sleep.cc:38:7: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
  if (args.Length() < 1 || !args[0]->IsUint32()) {
      ^~~~
      uv_process_options_s::args
/Users/kumavis/.node-gyp/0.12.7/deps/uv/include/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../sleep.cc:38:7: error: invalid use of non-static data member 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
      ^~~~
../sleep.cc:38:29: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
  if (args.Length() < 1 || !args[0]->IsUint32()) {
                            ^~~~
                            uv_process_options_s::args
/Users/kumavis/.node-gyp/0.12.7/deps/uv/include/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../sleep.cc:38:29: error: invalid use of non-static data member 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
                            ^~~~
../sleep.cc:39:12: error: use of undeclared identifier 'NanThrowError'; did you mean 'Nan::ThrowError'?
    return NanThrowError("Expected number of seconds");
           ^~~~~~~~~~~~~
           Nan::ThrowError
../../nan/nan.h:651:3: note: 'Nan::ThrowError' declared here
  X(Error)
  ^
../../nan/nan.h:639:21: note: expanded from macro 'X'
    NAN_INLINE void Throw ## NAME(const char *msg) {                           \
                    ^
<scratch space>:102:1: note: expanded from here
ThrowError
^
../sleep.cc:42:9: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
  sleep(args[0]->Uint32Value());
        ^~~~
        uv_process_options_s::args
/Users/kumavis/.node-gyp/0.12.7/deps/uv/include/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../sleep.cc:42:9: error: invalid use of non-static data member 'args'
  sleep(args[0]->Uint32Value());
        ^~~~
../sleep.cc:44:3: error: use of undeclared identifier 'NanReturnUndefined'
  NanReturnUndefined();
  ^
../sleep.cc:48:3: error: use of undeclared identifier 'NanScope'
  NanScope();
  ^
../sleep.cc:50:7: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
  if (args.Length() < 1 || !args[0]->IsUint32()) {
      ^~~~
      uv_process_options_s::args
/Users/kumavis/.node-gyp/0.12.7/deps/uv/include/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../sleep.cc:50:7: error: invalid use of non-static data member 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
      ^~~~
../sleep.cc:50:29: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
  if (args.Length() < 1 || !args[0]->IsUint32()) {
                            ^~~~
                            uv_process_options_s::args
/Users/kumavis/.node-gyp/0.12.7/deps/uv/include/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../sleep.cc:50:29: error: invalid use of non-static data member 'args'
  if (args.Length() < 1 || !args[0]->IsUint32()) {
                            ^~~~
../sleep.cc:51:12: error: use of undeclared identifier 'NanThrowError'; did you mean 'Nan::ThrowError'?
    return NanThrowError("Expected number of microseconds");
           ^~~~~~~~~~~~~
           Nan::ThrowError
../../nan/nan.h:651:3: note: 'Nan::ThrowError' declared here
  X(Error)
  ^
../../nan/nan.h:639:21: note: expanded from macro 'X'
    NAN_INLINE void Throw ## NAME(const char *msg) {                           \
                    ^
<scratch space>:102:1: note: expanded from here
ThrowError
^
../sleep.cc:54:10: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
  usleep(args[0]->Uint32Value());
         ^~~~
         uv_process_options_s::args
/Users/kumavis/.node-gyp/0.12.7/deps/uv/include/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../sleep.cc:54:10: error: invalid use of non-static data member 'args'
  usleep(args[0]->Uint32Value());
         ^~~~
../sleep.cc:56:3: error: use of undeclared identifier 'NanReturnUndefined'
  NanReturnUndefined();
  ^
../sleep.cc:61:16: error: use of undeclared identifier 'NanNew'
  exports->Set(NanNew<String>("sleep"), NanNew<FunctionTemplate>(Sleep)->GetFunction());
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/node_sleep/sleep.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/kumavis/.nvm/versions/node/v0.12.7/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "node" "/Users/kumavis/.nvm/versions/node/v0.12.7/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/kumavis/.nvm/versions/node/v0.12.7/lib/node_modules/lolcatjs/node_modules/sleep
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
/Users/kumavis/.nvm/versions/node/v0.12.7/lib
└─┬ [email protected] 
  β”œβ”€β”€ [email protected] 
  β”œβ”€β”€ [email protected] 
  β”œβ”€β”€ [email protected] 
  β”œβ”€β”¬ [email protected] 
  β”‚ └─┬ [email protected] 
  β”‚   └── [email protected] 
  └─┬ [email protected] 
    β”œβ”€β”€ [email protected] 
    β”œβ”€β”€ [email protected] 
    └── [email protected] 

npm WARN In [email protected] replacing bundled version of minimist with [email protected]
npm WARN In [email protected] replacing bundled version of multiline with [email protected]
npm WARN In [email protected] replacing bundled version of ansi with [email protected]
npm WARN In [email protected] replacing bundled version of line-by-line with [email protected]
npm WARN In [email protected] replacing bundled version of sleep with [email protected]
npm WARN In [email protected] replacing bundled version of terminal-kit with [email protected]
npm WARN In [email protected] replacing bundled version of strip-indent with [email protected]
npm WARN In [email protected] replacing bundled version of get-stdin with [email protected]
npm WARN In [email protected] replacing bundled version of nan with [email protected]
npm WARN In [email protected] replacing bundled version of string-kit with [email protected]
npm WARN In [email protected] replacing bundled version of tree-kit with [email protected]
npm WARN In [email protected] replacing bundled version of async-kit with [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.