@leverege/build-tools 2.4.9 → 2.5.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/lib/server/build-tools.js +144 -0
- package/lib/server/getfbcfg.js +25 -0
- package/lib/server/getjson.js +74 -0
- package/lib/server/npm-scripts/postinstall.js +19 -0
- package/lib/server/overwhelm.js +373 -0
- package/lib/server/repo-init/Config.js +45 -0
- package/lib/server/repo-init/RepoInit.js +176 -0
- package/lib/server/repo-init/config.tgz +0 -0
- package/lib/server/repo-init/gitter/Gitter.js +241 -0
- package/lib/server/repo-init/gitter/RepoHosting.js +106 -0
- package/lib/server/repo-init/gitter/index.js +9 -0
- package/lib/server/repo-init/index.js +6 -0
- package/lib/server/repo-init/templates/Templates.js +279 -0
- package/lib/server/repo-init/templates/ToBuildSpec.js +95 -0
- package/lib/server/repo-init/templates/index.js +9 -0
- package/lib/server/repo-init/utils/Shell.js +102 -0
- package/lib/server/repo-init/utils/VersionCheck.js +82 -0
- package/lib/server/repo-init/utils/index.js +67 -0
- package/lib/web/build-tools.js +144 -0
- package/lib/web/getfbcfg.js +25 -0
- package/lib/web/getjson.js +74 -0
- package/lib/web/npm-scripts/postinstall.js +19 -0
- package/lib/web/overwhelm.js +373 -0
- package/package.json +30 -29
- package/src/bash-funcs +61 -0
- package/src/build-tools.js +137 -0
- package/src/{getfbcfg → getfbcfg.js} +7 -6
- package/src/getjson.js +74 -0
- package/src/helmdn +1 -1
- package/src/npm-scripts/postinstall.js +17 -0
- package/src/{overwhelm → overwhelm.js} +83 -83
- package/lib/server/packleate/Packleator.js +0 -280
- package/lib/server/packleate/index.js +0 -98
- package/lib/server/packleate/logo-ansi.js +0 -17
- package/lib/web/packleate/Packleator.js +0 -623
- package/lib/web/packleate/index.js +0 -163
- package/lib/web/packleate/logo-ansi.js +0 -3
- package/src/getjson +0 -48
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
require("core-js/modules/es.symbol");
|
|
5
|
-
|
|
6
|
-
require("core-js/modules/es.array.filter");
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.array.for-each");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.object.get-own-property-descriptor");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.object.keys");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.object.to-string");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.promise");
|
|
19
|
-
|
|
20
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
21
|
-
|
|
22
|
-
require("regenerator-runtime/runtime");
|
|
23
|
-
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
-
|
|
28
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
-
|
|
30
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
31
|
-
|
|
32
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
33
|
-
|
|
34
|
-
var commandLineArgs = require('command-line-args');
|
|
35
|
-
|
|
36
|
-
var commandLineUsage = require('command-line-usage');
|
|
37
|
-
|
|
38
|
-
var path = require('path');
|
|
39
|
-
|
|
40
|
-
var Packleator = require('./Packleator');
|
|
41
|
-
|
|
42
|
-
var ansiLogo = require('./logo-ansi');
|
|
43
|
-
|
|
44
|
-
var defaultConfig = {
|
|
45
|
-
namespaces: ['@leverege'],
|
|
46
|
-
output: 'lev_dest'
|
|
47
|
-
};
|
|
48
|
-
var sections = [{
|
|
49
|
-
content: ansiLogo,
|
|
50
|
-
raw: true
|
|
51
|
-
}, {
|
|
52
|
-
content: 'Bundles private/proprietary npm packages and source code into a tarball for distribution'
|
|
53
|
-
}, {
|
|
54
|
-
header: 'Options',
|
|
55
|
-
optionList: [{
|
|
56
|
-
name: 'output',
|
|
57
|
-
alias: 'o',
|
|
58
|
-
description: 'The destination folder (optional)',
|
|
59
|
-
defaultValue: 'lev_dest'
|
|
60
|
-
}, {
|
|
61
|
-
name: 'ignore',
|
|
62
|
-
alias: 'i',
|
|
63
|
-
description: 'List of files or folders to ignore. Uses glob pattern matching (optional)',
|
|
64
|
-
multiple: true
|
|
65
|
-
}, {
|
|
66
|
-
name: 'namespaces',
|
|
67
|
-
alias: 'n',
|
|
68
|
-
description: 'List of npm namespaces to be considered private/proprietary (optional)',
|
|
69
|
-
multiple: true
|
|
70
|
-
}, {
|
|
71
|
-
name: 'verbose',
|
|
72
|
-
alias: 'v',
|
|
73
|
-
description: 'Log a little bit louder now'
|
|
74
|
-
}, {
|
|
75
|
-
name: 'help',
|
|
76
|
-
description: 'Print this usage guide.'
|
|
77
|
-
}]
|
|
78
|
-
}];
|
|
79
|
-
var usage = commandLineUsage(sections);
|
|
80
|
-
var optionDefinitions = [{
|
|
81
|
-
name: 'output',
|
|
82
|
-
alias: 'o',
|
|
83
|
-
type: String,
|
|
84
|
-
defaultValue: defaultConfig.output
|
|
85
|
-
}, {
|
|
86
|
-
name: 'ignore',
|
|
87
|
-
alias: 'i',
|
|
88
|
-
type: String,
|
|
89
|
-
multiple: true,
|
|
90
|
-
defaultValue: []
|
|
91
|
-
}, {
|
|
92
|
-
name: 'namespaces',
|
|
93
|
-
alias: 'n',
|
|
94
|
-
type: String,
|
|
95
|
-
defaultValue: defaultConfig.namespaces
|
|
96
|
-
}, {
|
|
97
|
-
name: 'verbose',
|
|
98
|
-
alias: 'v',
|
|
99
|
-
type: Boolean,
|
|
100
|
-
defaultValue: false
|
|
101
|
-
}, {
|
|
102
|
-
name: 'help',
|
|
103
|
-
type: Boolean
|
|
104
|
-
}];
|
|
105
|
-
var args = commandLineArgs(optionDefinitions);
|
|
106
|
-
|
|
107
|
-
function main() {
|
|
108
|
-
return _main.apply(this, arguments);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function _main() {
|
|
112
|
-
_main = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
113
|
-
var packleator;
|
|
114
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
115
|
-
while (1) {
|
|
116
|
-
switch (_context.prev = _context.next) {
|
|
117
|
-
case 0:
|
|
118
|
-
if (!args.help) {
|
|
119
|
-
_context.next = 4;
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
console.log(usage);
|
|
124
|
-
_context.next = 16;
|
|
125
|
-
break;
|
|
126
|
-
|
|
127
|
-
case 4:
|
|
128
|
-
packleator = new Packleator(_objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
129
|
-
args: args
|
|
130
|
-
}));
|
|
131
|
-
|
|
132
|
-
if (args.verbose) {
|
|
133
|
-
console.log(packleator.args);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
_context.prev = 6;
|
|
137
|
-
_context.next = 9;
|
|
138
|
-
return packleator.getPackageJson();
|
|
139
|
-
|
|
140
|
-
case 9:
|
|
141
|
-
_context.next = 11;
|
|
142
|
-
return packleator.run();
|
|
143
|
-
|
|
144
|
-
case 11:
|
|
145
|
-
_context.next = 16;
|
|
146
|
-
break;
|
|
147
|
-
|
|
148
|
-
case 13:
|
|
149
|
-
_context.prev = 13;
|
|
150
|
-
_context.t0 = _context["catch"](6);
|
|
151
|
-
console.error(_context.t0.message);
|
|
152
|
-
|
|
153
|
-
case 16:
|
|
154
|
-
case "end":
|
|
155
|
-
return _context.stop();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}, _callee, null, [[6, 13]]);
|
|
159
|
-
}));
|
|
160
|
-
return _main.apply(this, arguments);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
main();
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = "\x1B[0;5;37;47m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \x1B[0m\n\x1B[0;5;37;47m . . S% . . . . . . . . . . . . . . . . . . \x1B[0m\n\x1B[0;5;37;47m . .:\x1B[0;1;30;47m%\x1B[0;1;37;47m \x1B[0;5;37;47m: . . . .. . . . . . ...... . ... .. . . . .. .. . ..... . .... . .. . ..... . ... . ..... . .. . . ..... . . . . \x1B[0m\n\x1B[0;5;37;47m . :\x1B[0;1;34;46m8\x1B[0;1;30;47m8\x1B[0;5;37;47m:.. . . .8: . \x1B[0;1;37;47m.\x1B[0;5;37;40m8\x1B[0;1;30;47m.\x1B[0;5;37;47m . .. \x1B[0;1;37;47m@\x1B[0;5;37;40m8\x1B[0;1;30;47mX@@@@@@8%\x1B[0;5;37;47m \x1B[0;1;37;47m@\x1B[0;1;30;47m88\x1B[0;5;37;47mX . . t\x1B[0;1;30;47mX8\x1B[0;1;37;47m%\x1B[0;5;37;47m 8\x1B[0;1;30;47m88@@@@@@@@\x1B[0;5;37;47mt. \x1B[0;1;37;47mt\x1B[0;5;37;40m8\x1B[0;1;30;47m@@@@@%\x1B[0;1;37;47m;\x1B[0;5;37;47m% . . \x1B[0;1;37;47m@\x1B[0;5;37;40m8\x1B[0;1;30;47m@@@@@@@8%\x1B[0;5;37;47m. .. ;\x1B[0;1;37;47mt\x1B[0;1;30;47m%88t\x1B[0;1;37;47m@\x1B[0;5;37;47m. .:\x1B[0;1;30;47mX8@@@@@@@8\x1B[0;1;37;47m8\x1B[0;5;37;47m . . .\x1B[0m\n\x1B[0;5;37;47m . .. 8\x1B[0;5;34;44m8\x1B[0;1;30;46m8\x1B[0;5;37;47m8:. . .\x1B[0;1;37;47mX\x1B[0;1;31;47m8\x1B[0;5;37;47mS . . \x1B[0;5;37;40mS\x1B[0;34;40m%\x1B[0;5;35;40m \x1B[0;5;37;47m . . \x1B[0;1;30;47m:\x1B[0;34;40mS\x1B[0;5;30;40m@\x1B[0;5;35;40m;\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40m%\x1B[0;5;36;40m.\x1B[0;5;37;47m S\x1B[0;5;35;40mt\x1B[0;34;40m%\x1B[0;5;37;40m8\x1B[0;5;37;47m.. . \x1B[0;1;30;47m@\x1B[0;34;40mS\x1B[0;5;35;40m;\x1B[0;5;37;47m@ \x1B[0;1;37;47mX\x1B[0;1;30;40mX\x1B[0;5;30;40m8\x1B[0;5;34;40mS\x1B[0;5;35;40m:\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;37;47m@ \x1B[0;1;30;47m8\x1B[0;34;40mS\x1B[0;5;30;40mS\x1B[0;5;35;40m;\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;34;40mS\x1B[0;1;30;40m8\x1B[0;5;30;40m8\x1B[0;5;35;40m \x1B[0;5;37;47mX.. \x1B[0;1;30;47m;\x1B[0;34;40mS\x1B[0;5;30;40mX\x1B[0;5;36;40m;\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40m%\x1B[0;5;35;40m \x1B[0;5;37;47m. ..\x1B[0;1;37;47mt\x1B[0;5;36;40m \x1B[0;5;34;40m@\x1B[0;1;30;40m8\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;30;40mX8\x1B[0;5;34;40m8\x1B[0;5;33;40m \x1B[0;5;37;47mt. t\x1B[0;5;34;40m@\x1B[0;1;30;40m@\x1B[0;5;34;40mS\x1B[0;5;33;40m:\x1B[0;5;35;40mt\x1B[0;5;36;40m%\x1B[0;5;35;40m%\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;34;40mS\x1B[0;1;37;47mt\x1B[0;5;37;47m . . \x1B[0m\n\x1B[0;5;37;47m . . @\x1B[0;5;36;44m8\x1B[0;34;46m8\x1B[0;1;30;47m8\x1B[0;5;37;47m8;. :\x1B[0;1;37;47mt\x1B[0;5;33;41m \x1B[0;5;37;43m@\x1B[0;5;37;47m8;. . \x1B[0;5;37;40m@\x1B[0;1;30;40m@\x1B[0;5;35;40m \x1B[0;5;37;47m . \x1B[0;1;30;47m.\x1B[0;1;30;40m8\x1B[0;5;34;40mS\x1B[0;5;37;47mS:;:;:: . \x1B[0;1;37;47m8\x1B[0;5;32;40mS\x1B[0;34;40mS\x1B[0;1;30;47m.\x1B[0;5;37;47m . . \x1B[0;1;37;47m;\x1B[0;5;30;40m8@\x1B[0;1;37;47m@\x1B[0;5;37;47m. \x1B[0;1;37;47mX\x1B[0;1;30;40m8\x1B[0;5;30;40m8\x1B[0;1;37;47m@\x1B[0;5;37;47m.;:;:;. . \x1B[0;1;30;47mX\x1B[0;1;30;40m@\x1B[0;5;36;40m:\x1B[0;5;37;47m;::;.;\x1B[0;1;30;47mX\x1B[0;1;30;40m8\x1B[0;5;35;40mt\x1B[0;5;37;47m%. \x1B[0;1;30;47m.\x1B[0;1;30;40m8\x1B[0;5;34;40mS\x1B[0;5;37;47mX:;:;:: .%\x1B[0;5;35;40m \x1B[0;1;30;40m8\x1B[0;5;35;40m:\x1B[0;1;37;47m:\x1B[0;5;37;47mt;:: S\x1B[0;1;30;47m \x1B[0;1;37;47mS\x1B[0;5;37;47m . t\x1B[0;5;30;40mS\x1B[0;1;30;40mX\x1B[0;1;30;47mt\x1B[0;5;37;47m.;;:;:. . \x1B[0m\n\x1B[0;5;37;47m . \x1B[0;1;37;47m \x1B[0;5;34;44m8\x1B[0;1;34;46m8\x1B[0;36;44m8\x1B[0;1;37;47m;\x1B[0;5;37;47m .t\x1B[0;5;37;41m8\x1B[0;5;33;41m \x1B[0;5;33;43m.\x1B[0;1;35;47mX\x1B[0;5;37;47m:. . \x1B[0;5;37;40mX\x1B[0;34;40mS\x1B[0;5;37;40m@\x1B[0;5;37;47m . . \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;5;37;47mt . . . \x1B[0;1;30;47mS\x1B[0;1;30;40m8\x1B[0;5;34;40mS\x1B[0;5;37;47mS . :\x1B[0;5;36;40m.\x1B[0;34;40m%\x1B[0;1;30;47mX\x1B[0;5;37;47m : \x1B[0;1;37;47m@\x1B[0;1;30;40m@\x1B[0;5;30;40m8\x1B[0;1;37;47m8\x1B[0;5;37;47m . . . \x1B[0;1;30;47m@\x1B[0;34;40mS\x1B[0;5;35;40m \x1B[0;5;37;47m. . \x1B[0;1;37;47m8\x1B[0;5;30;40m88\x1B[0;5;37;47m8 \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;5;37;47m; . .. \x1B[0;1;30;47m@\x1B[0;1;30;40m@\x1B[0;5;34;40m@\x1B[0;5;37;47m8.. .... t\x1B[0;5;34;40m%\x1B[0;1;30;40mS\x1B[0;1;30;47m:\x1B[0;5;37;47m.. . . . . \x1B[0m\n\x1B[0;5;37;47m . . . ..\x1B[0;1;30;47m8\x1B[0;5;36;44m8\x1B[0;1;30;46m8\x1B[0;5;34;44mS\x1B[0;1;30;47mt\x1B[0;5;37;47mS\x1B[0;1;37;47m \x1B[0;5;1;33;41m8\x1B[0;5;33;41m:\x1B[0;1;37;47m \x1B[0;5;37;47m... . . \x1B[0;5;37;40m@\x1B[0;1;30;40m@\x1B[0;5;35;40m \x1B[0;5;37;47m .. \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40m@\x1B[0;5;36;40m \x1B[0;5;35;40m \x1B[0;5;36;40m \x1B[0;5;37;47mt ..%\x1B[0;5;35;40m;\x1B[0;32;40mt\x1B[0;1;30;47m@\x1B[0;5;37;47m.. \x1B[0;1;30;47m;\x1B[0;1;30;40m@\x1B[0;5;35;40m.\x1B[0;5;37;47mS . \x1B[0;1;37;47mX\x1B[0;1;30;40m8\x1B[0;5;34;40m8\x1B[0;5;33;40m;\x1B[0;5;35;40m.\x1B[0;5;36;40m \x1B[0;5;35;40m .\x1B[0;1;37;47m8\x1B[0;5;37;47m : \x1B[0;1;30;47mX\x1B[0;1;30;40m@\x1B[0;5;35;40m.\x1B[0;5;37;47m: ...t\x1B[0;1;30;47m8\x1B[0;34;40mX\x1B[0;5;36;40m.\x1B[0;5;37;47mt. \x1B[0;1;30;47m:\x1B[0;1;30;40m@\x1B[0;5;30;40m@\x1B[0;5;35;40m \x1B[0;5;37;47mS .\x1B[0;5;35;40m.\x1B[0;34;40mS\x1B[0;5;37;40m8\x1B[0;5;37;47m.. . %X; t\x1B[0;5;30;40mX\x1B[0;1;30;40m8\x1B[0;5;36;40m;\x1B[0;5;35;40m.\x1B[0;5;36;40m .\x1B[0;1;30;47m \x1B[0;5;37;47m . . . \x1B[0m\n\x1B[0;5;37;47m . . t\x1B[0;36;47m8\x1B[0;5;34;44m8\x1B[0;1;30;46m8\x1B[0;5;36;44m8\x1B[0;5;36;40mX\x1B[0;1;37;47m \x1B[0;5;37;47m%8t . .. \x1B[0;5;37;40m@\x1B[0;34;40mS\x1B[0;5;37;40mX\x1B[0;5;37;47m . . \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;34;40mX\x1B[0;1;30;47m \x1B[0;1;37;47m;;;;:t\x1B[0;5;37;47m: ..\x1B[0;1;37;47m8\x1B[0;5;34;40mS\x1B[0;1;30;40m@\x1B[0;1;37;47m:\x1B[0;5;37;47m.\x1B[0;1;37;47mX\x1B[0;5;30;40m88\x1B[0;1;37;47m8\x1B[0;5;37;47m .. \x1B[0;1;37;47mX\x1B[0;1;30;40m88\x1B[0;1;30;47mS\x1B[0;1;37;47m::;;;.\x1B[0;5;37;47m% . \x1B[0;1;30;47m@\x1B[0;1;30;40mX\x1B[0;5;34;40m@\x1B[0;5;33;40m%\x1B[0;5;34;40mS\x1B[0;5;33;40m;\x1B[0;5;35;40m%\x1B[0;5;36;40mX\x1B[0;1;30;40m8\x1B[0;5;30;40mX\x1B[0;5;37;40m@\x1B[0;5;37;47mX . \x1B[0;1;30;47m:\x1B[0;34;40m@\x1B[0;5;33;40mt\x1B[0;1;30;47m;\x1B[0;1;37;47m;;;;:;\x1B[0;5;37;47m;. \x1B[0;5;37;40m%\x1B[0;1;30;40m@\x1B[0;5;33;40m \x1B[0;5;37;47m.. .. \x1B[0;5;36;40m \x1B[0;34;40m%\x1B[0;1;37;47mt\x1B[0;5;37;47m. t\x1B[0;5;34;40m%\x1B[0;1;30;40mX\x1B[0;5;37;40m8\x1B[0;1;37;47m;:;;; \x1B[0;5;37;47m8.. . \x1B[0m\n\x1B[0;5;37;47m . . . .:8\x1B[0;1;30;46m8\x1B[0;5;34;44mX\x1B[0;5;36;40mt\x1B[0;5;34;44mt\x1B[0;34;46m8\x1B[0;1;30;47m8\x1B[0;5;37;47m . . \x1B[0;5;37;40m@\x1B[0;1;30;40mX\x1B[0;5;35;40m \x1B[0;5;37;47m ..... \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;34;40mS\x1B[0;5;37;47mS..:..:.. . \x1B[0;1;30;47m@\x1B[0;1;30;40mX\x1B[0;5;35;40m;\x1B[0;5;37;47m:\x1B[0;5;35;40m \x1B[0;34;40mS\x1B[0;1;30;47mS\x1B[0;5;37;47m . . \x1B[0;1;37;47mX\x1B[0;1;30;40m8\x1B[0;5;30;40m8\x1B[0;1;37;47m@\x1B[0;5;37;47m ::.:.. . \x1B[0;1;30;47m@\x1B[0;1;30;40mX\x1B[0;5;30;40mX\x1B[0;1;30;47m@X@@\x1B[0;5;30;40mS\x1B[0;1;30;40m@\x1B[0;1;30;47mt\x1B[0;5;37;47m ... \x1B[0;1;30;47m.\x1B[0;1;30;40m@\x1B[0;5;34;40m@\x1B[0;5;37;47mS ::..:.. \x1B[0;1;37;47m;\x1B[0;1;30;40m88\x1B[0;1;30;47mt\x1B[0;5;37;47m ..... \x1B[0;5;37;40mS\x1B[0;1;30;40mX\x1B[0;1;37;47m:\x1B[0;5;37;47m t\x1B[0;5;30;40mS\x1B[0;1;30;40mX\x1B[0;1;30;47m;\x1B[0;5;37;47m ::.:... . \x1B[0m\n\x1B[0;5;37;47m . . \x1B[0;1;37;47m:\x1B[0;1;34;46m8\x1B[0;1;30;46m8\x1B[0;1;34;46m8\x1B[0;1;30;45m8\x1B[0;5;37;47m% . . \x1B[0;5;37;40m@\x1B[0;1;30;40mX\x1B[0;5;35;40m \x1B[0;5;37;47mS8@@8@: \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;1;37;47m8\x1B[0;5;37;47mX@X@X@X: . %\x1B[0;5;35;40m;\x1B[0;1;30;40m8\x1B[0;5;36;40m \x1B[0;5;34;40m@\x1B[0;5;33;40m%\x1B[0;5;37;47mX . . \x1B[0;1;37;47m@\x1B[0;1;30;40m8\x1B[0;5;34;40m8\x1B[0;1;37;47m:\x1B[0;5;37;47mS@X@X@@;. \x1B[0;1;30;47m@\x1B[0;34;40mX\x1B[0;5;36;40m \x1B[0;5;37;47m. ..\x1B[0;1;37;47m8\x1B[0;5;34;40mX\x1B[0;1;30;40m8\x1B[0;1;30;47m;\x1B[0;5;37;47m .. \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;1;37;47m8\x1B[0;5;37;47mS@X@X@@: \x1B[0;1;30;47mt\x1B[0;5;30;40m88\x1B[0;5;36;40m \x1B[0;1;37;47mt\x1B[0;5;37;47m8%S\x1B[0;1;37;47m8:\x1B[0;5;36;40m;\x1B[0;34;40mt\x1B[0;1;37;47m:\x1B[0;5;37;47m t\x1B[0;5;34;40m%\x1B[0;1;30;40mX\x1B[0;1;30;47mS\x1B[0;5;37;47mX@@X@X@% . . \x1B[0m\n\x1B[0;5;37;47m . . . . . \x1B[0;1;37;47m:\x1B[0;5;34;44mX\x1B[0;1;30;47m8\x1B[0;5;37;47m@.: . . \x1B[0;5;37;40m8\x1B[0;5;30;40m8\x1B[0;5;34;40mX\x1B[0;5;30;40m8@8\x1B[0;5;34;40m8\x1B[0;5;30;40m8S\x1B[0;5;37;47mS \x1B[0;1;30;47m.\x1B[0;5;30;40m8\x1B[0;5;34;40m@\x1B[0;5;30;40m@88\x1B[0;5;34;40m8\x1B[0;5;30;40m8@\x1B[0;5;34;40m8\x1B[0;5;30;40m8\x1B[0;5;37;47m8.. ..\x1B[0;1;37;47m8\x1B[0;5;34;40mS\x1B[0;5;30;40m@X\x1B[0;1;37;47m8\x1B[0;5;37;47m . . \x1B[0;1;37;47m@\x1B[0;5;30;40m8@@\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m8\x1B[0;5;34;40m@\x1B[0;1;30;40m8\x1B[0;1;37;47m;\x1B[0;5;37;47m \x1B[0;1;30;47mS\x1B[0;5;30;40m8\x1B[0;5;36;40m \x1B[0;5;37;47m. . .@\x1B[0;5;35;40m.\x1B[0;5;30;40m8\x1B[0;5;37;40mS\x1B[0;5;37;47mt. \x1B[0;1;30;47m.\x1B[0;5;30;40m8\x1B[0;5;34;40m@\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;37;47m8...%\x1B[0;1;37;47m \x1B[0;5;37;40mS\x1B[0;5;36;40m%\x1B[0;5;30;40m888\x1B[0;5;34;40mX\x1B[0;5;33;40mt\x1B[0;5;37;40m@\x1B[0;1;37;47mt\x1B[0;5;37;47m; .;\x1B[0;5;33;40m%\x1B[0;5;30;40m8\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m@\x1B[0;1;30;40m@\x1B[0;1;30;47m8\x1B[0;5;37;47m . . .\x1B[0m\n\x1B[0;5;37;47m . \x1B[0;36;47m8\x1B[0;1;37;47m \x1B[0;5;37;47m:.. .;;:::;::. :;;::::;:;:. .:;. .;:;::;::::. .;: . .:;: :;:::::::::: . ..:t;:: . :%;;:::::::. . \x1B[0m\n\x1B[0;5;37;47m . . . . . X% . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . .. . . . \x1B[0m\n\x1B[0;5;37;47m . .. . . . . . . . . . . . . . . . . . . . . . . . .\x1B[0m";
|
package/src/getjson
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This script will allow the user to grab a value from a JSON file and
|
|
5
|
-
* optionally apply a regular expression to it. Given this test.json file:
|
|
6
|
-
*
|
|
7
|
-
* {
|
|
8
|
-
* "name": "@leverege/packagename",
|
|
9
|
-
* "main": "lib/index.js"
|
|
10
|
-
* }
|
|
11
|
-
*
|
|
12
|
-
* and invoking as:
|
|
13
|
-
* ./getjson --file ./test.json --key name --regex "^@\w{3}"
|
|
14
|
-
*
|
|
15
|
-
* will yield an output of: @lev
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Get a command line switch parser.
|
|
20
|
-
*/
|
|
21
|
-
const fs = require( 'fs' )
|
|
22
|
-
const opts = require( 'commander' )
|
|
23
|
-
|
|
24
|
-
opts
|
|
25
|
-
.version( '0.0.1' )
|
|
26
|
-
.option( '-f, --file <file name>', 'file to parse JSON from' )
|
|
27
|
-
.option( '-k, --key <key>', 'JSON key whose value to grab' )
|
|
28
|
-
.option( '-r, --regex <reg>', 'regular expression to apply to the value' )
|
|
29
|
-
.parse( process.argv )
|
|
30
|
-
|
|
31
|
-
if( !opts.key ) { return }
|
|
32
|
-
|
|
33
|
-
if( !opts.file ) {
|
|
34
|
-
console.error( `\n***ERROR: Missing a --file param\n` )
|
|
35
|
-
opts.outputHelp()
|
|
36
|
-
process.exit( 1 )
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
const json = JSON.parse( fs.readFileSync( opts.file, 'utf8' ))
|
|
41
|
-
const value = json[opts.key]
|
|
42
|
-
const match = new RegExp( opts.regex || ".*" ).exec( value )
|
|
43
|
-
|
|
44
|
-
console.log( match ? match[match.length-1] : '' )
|
|
45
|
-
}
|
|
46
|
-
catch( e ) {
|
|
47
|
-
console.log( e )
|
|
48
|
-
}
|