~webapps/unity-js-scopes/node.js

« back to all changes in this revision

Viewing changes to deps/npm/lib/xmas.js

  • Committer: Marcus Tomlinson
  • Date: 2015-11-13 07:59:04 UTC
  • Revision ID: marcus.tomlinson@canonical.com-20151113075904-h0swczmoq1rvstfc
Node v4 (stable)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// happy xmas
 
2
var log = require("npmlog")
 
3
 
 
4
module.exports = function (args, cb) {
 
5
var s = process.platform === "win32" ? " *" : " \u2605"
 
6
  , f = "\uFF0F"
 
7
  , b = "\uFF3C"
 
8
  , x = process.platform === "win32" ? " " : ""
 
9
  , o = [ "\u0069" , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020"
 
10
        , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020", "\u0020"
 
11
        , "\u0020", "\u2E1B","\u2042","\u2E2E","&","@","\uFF61" ]
 
12
  , oc = [21,33,34,35,36,37]
 
13
  , l = "\u005e"
 
14
 
 
15
function w (s) { process.stderr.write(s) }
 
16
 
 
17
w("\n")
 
18
;(function T (H) {
 
19
  for (var i = 0; i < H; i ++) w(" ")
 
20
  w(x+"\033[33m"+s+"\n")
 
21
  var M = H * 2 - 1
 
22
  for (var L = 1; L <= H; L ++) {
 
23
    var O = L * 2 - 2
 
24
    var S = (M - O) / 2
 
25
    for (i = 0; i < S; i ++) w(" ")
 
26
    w(x+"\033[32m"+f)
 
27
    for (i = 0; i < O; i ++) w(
 
28
      "\033["+oc[Math.floor(Math.random()*oc.length)]+"m"+
 
29
      o[Math.floor(Math.random() * o.length)]
 
30
    )
 
31
    w(x+"\033[32m"+b+"\n")
 
32
  }
 
33
  w(" ")
 
34
  for (i = 1; i < H; i ++) w("\033[32m"+l)
 
35
  w("| "+x+" |")
 
36
  for (i = 1; i < H; i ++) w("\033[32m"+l)
 
37
  if (H > 10) {
 
38
    w("\n ")
 
39
    for (i = 1; i < H; i ++) w(" ")
 
40
    w("| "+x+" |")
 
41
    for (i = 1; i < H; i ++) w(" ")
 
42
  }
 
43
})(20)
 
44
w("\n\n")
 
45
log.heading = ''
 
46
log.addLevel('npm', 100000, log.headingStyle)
 
47
log.npm("loves you", "Happy Xmas, Noders!")
 
48
cb()
 
49
}
 
50
var dg=false
 
51
Object.defineProperty(module.exports, "usage", {get:function () {
 
52
  if (dg) module.exports([], function () {})
 
53
  dg = true
 
54
  return " "
 
55
}})