Compare commits
199 Commits
Author | SHA1 | Date | |
---|---|---|---|
c9e92e9549 | |||
0309e037a0 | |||
872385dbc4 | |||
922591d45d | |||
a39a2bdfa8 | |||
93128628cc | |||
023b3ff377 | |||
8e3f65061a | |||
1f9bfcc856 | |||
04686b810f | |||
f9afc486f3 | |||
ce6bdb984c | |||
10fa0af94c | |||
0a3f6da174 | |||
9073d9a7f8 | |||
890cd463d5 | |||
186766df3d | |||
62ff7ec717 | |||
ca3286625d | |||
ff33c9597a | |||
65604d4ec0 | |||
f83c8feb3e | |||
2b7a4ff07a | |||
1c59952bb5 | |||
bb48d3cb04 | |||
64a555748e | |||
34fd838e80 | |||
b48b2a77b0 | |||
99c2c2e84f | |||
bf791d732c | |||
e5e7f00353 | |||
78bd0605aa | |||
f1e3ca6014 | |||
0712d47155 | |||
2a9b686e94 | |||
a9180878d5 | |||
4a1214a87f | |||
d85878713e | |||
9d65e37a60 | |||
5dd07e34ed | |||
ba7727dc55 | |||
7c85387c85 | |||
c978ada06c | |||
ca749d45b1 | |||
89efae2eb7 | |||
5da96c42c6 | |||
127476c86e | |||
7c1eb711da | |||
0edaa51679 | |||
db46fca769 | |||
824efb1fc8 | |||
9d386f7c45 | |||
be3bdde24b | |||
271fd4817e | |||
5288a1583d | |||
21979e431d | |||
fdd3498d78 | |||
f93317bd02 | |||
0e0a8dfebd | |||
06c29f97b1 | |||
8e3dc5b003 | |||
07d19416fd | |||
2c011ae852 | |||
b6c0b17ef8 | |||
f72f5a0765 | |||
b6d6766c91 | |||
7b238535c8 | |||
0b94ab3a04 | |||
224ed76018 | |||
382d00cfa6 | |||
f6b9e7a4db | |||
ffe65ff1bc | |||
6eb2f8d623 | |||
0244885479 | |||
615e1fe077 | |||
62f2f23522 | |||
56a7ab7858 | |||
a343f715aa | |||
7e4012ccf7 | |||
a42dd0ed45 | |||
b68eba502f | |||
9f20a533be | |||
2d472b3097 | |||
6c93946215 | |||
dcc0eef2fd | |||
f0a3aef9cc | |||
5f1ff6e3ff | |||
afaeaee114 | |||
96ea0eb7b2 | |||
4487fa6937 | |||
e705141f6d | |||
cbfc000f7c | |||
bd0790fec6 | |||
643a302aeb | |||
70bc355cc1 | |||
79361eefbc | |||
2c8f5d2c49 | |||
b0406a941d | |||
80799156ab | |||
8aa178e576 | |||
2079a6df88 | |||
03d1a62f8d | |||
f1aab3c3ea | |||
1e32e9816a | |||
44e6401472 | |||
efeb2507bc | |||
92c4ca336d | |||
59cd6da99b | |||
b02e6ff951 | |||
1d92e1a4bf | |||
92bf5cb6c0 | |||
f19df7db78 | |||
d3d722b352 | |||
ba6dbc3915 | |||
35fd765546 | |||
234ce34f4b | |||
69eb73f8c1 | |||
a0ba51718c | |||
818df0c367 | |||
3ecea716b9 | |||
80cf15c234 | |||
67d6dc2601 | |||
5ef0d6a405 | |||
f673f7ab26 | |||
9b5eed2f76 | |||
772ec5e941 | |||
087ee94af8 | |||
edc3a09bf0 | |||
6907a72f0b | |||
da44542100 | |||
93b6ab03cd | |||
5b1e406aeb | |||
50ea38db85 | |||
a91a9d3d0a | |||
2caaf95fe9 | |||
9c5d7b382c | |||
40b77759f5 | |||
4251b4c3b4 | |||
7efb424550 | |||
667e3c39d5 | |||
81e42a9b13 | |||
|
fb20d0ff90 | ||
|
d11fe70827 | ||
132c0bc8b7 | |||
f17637b69c | |||
ee4ad0bde2 | |||
3db36e95ea | |||
1a7f4ab04c | |||
956278a3ce | |||
86d8816ebc | |||
38684f2a88 | |||
2d69cbe4b5 | |||
939121c63b | |||
bdd3723af8 | |||
e7cc9b0e00 | |||
ebe1499daa | |||
d8d9fef7e8 | |||
05b5e8ddb1 | |||
4eb1bf4fe1 | |||
b319ec41f0 | |||
cfd116421c | |||
de2e538e11 | |||
57dd2586fd | |||
542db5a2cf | |||
5f24ae865a | |||
13622b4ed7 | |||
68567c5e41 | |||
a790c3fc8e | |||
f5b51e2747 | |||
fc1b61e7de | |||
|
234c393749 | ||
|
6875881cf3 | ||
|
043639ebff | ||
|
a70a96edfd | ||
|
011de8362b | ||
|
d9fc0d333c | ||
|
256caf4e65 | ||
|
128a81150e | ||
|
e80a20be70 | ||
309b951383 | |||
ccc9444d90 | |||
f01ad2724b | |||
a11a1a11ba | |||
61a7fb7541 | |||
f41d6fd45e | |||
6f9fe13d28 | |||
28a2745ca0 | |||
409b92ed6a | |||
9ca282c07b | |||
978f125d8b | |||
dd4be7ef8b | |||
dde45628a3 | |||
6fbbb074eb | |||
ad75199ffb | |||
ef732bd178 | |||
51976b9e2f | |||
c6a6b7aee4 | |||
584dd97941 | |||
fdc4a3bfde |
@ -1 +0,0 @@
|
||||
{}
|
23
.gitignore
vendored
23
.gitignore
vendored
@ -1,11 +1,20 @@
|
||||
node_modules/
|
||||
.settings/
|
||||
.idea/
|
||||
.nogit/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
pages/
|
||||
|
||||
#npm devug
|
||||
npm-debug.log
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
ts/*.js
|
||||
ts/*.js.map
|
||||
# caches
|
||||
.yarn/
|
||||
.cache/
|
||||
.rpt2_cache
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_*/
|
||||
|
||||
# custom
|
128
.gitlab-ci.yml
Normal file
128
.gitlab-ci.yml
Normal file
@ -0,0 +1,128 @@
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- pnpm install -g pnpm
|
||||
- pnpm install -g @shipzone/npmci
|
||||
- npmci npm prepare
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command pnpm audit --audit-level=high --prod
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command pnpm audit --audit-level=high --dev
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run buildDocs
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
12
.npmignore
12
.npmignore
@ -1,7 +1,11 @@
|
||||
test/
|
||||
ts/
|
||||
.idea/
|
||||
node_modules/
|
||||
coverage/
|
||||
pages/
|
||||
public/
|
||||
|
||||
ts/typings/
|
||||
ts/
|
||||
docs/
|
||||
|
||||
|
||||
|
||||
.nogit/
|
||||
|
15
.travis.yml
15
.travis.yml
@ -1,15 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "4.3.1"
|
||||
- "stable"
|
||||
deploy:
|
||||
provider: npm
|
||||
email: npm@lossless.digital
|
||||
api_key:
|
||||
secure: NFZBWxf3BEuTu7eEQNqLtn7QD4pUJYovHVPL9x9iSx8wNCRL5keSPRx8vlmVTx4ddk5KmIERlw3i7ZLrF72msaiuU34kBh6edOpeswfBE0zR/WbV4ZU/LdxaP4bevYsl+gJnt5A4jHHFO6mqFp/R5vnqVkX3sAsPNr6cEVo8b3uNHHVxqs/gsoU/XBrNmQxPVbK1E/sVabZ/9blujxxTzGoyXbC2dIaD5sJ6z/mSagw1sCwrOdM7o0UDzsm81AtnFGegAmkd5Ps0dlcVdulKEcQkkfd9D3iq4SQ3efQVTSqD559bazxADf5VicoaEPAv8OVe8vKtc76KCiZfR5463Jl3LUoAt7UsX73aEsIg1cTsxkJCsGoiUqUQEucYKt8UcoicXJp2IUXRVkOxeXRRapERJgVKSSI965J5VqF3ZKWMnxfjrLde++wdrJ9L7EaTJbwDJohV4jqo794lv1yL+wWGO18NETQ01eV9LRDYCH/NOmWY7AZDNj2I1Ou2YImqxrFJfi1up4lOa+A4bcs6NSh3p/if4xBdOa5ALAWqQ7iUk1FReMPsLXZNLIgtUPbal+yR37DWDZ6imiYfJ5IMRV01yPGP6sBLnveTGR6DH1SxiycmIc0NOqFXjmgjtopCwRrpCUb1GBxMSNunvKyxrPJ+7Sxvbupcek3/tHf+z5g=
|
||||
on:
|
||||
tags: true
|
||||
repo: pushrocks/beautylog
|
||||
notifications:
|
||||
slack:
|
||||
secure: VBAcnFNkROLEa0vrp0qu8rBC8OlOvxpnYwqv3NMIbLie3Cq1YS03DwhqX0YV1hEBiGqh5cBe3s3PxtY8LHF5QjB4/82nQJSUHdcUxPTLh9Eq6IZaKCnSEFhMKPbZw0TwULIlbLv1RV/te1+G+fVKguCn4+f5TqTRxntYErVQu/0ovDa9ln3vtlqhDg9lYk3FBFqOszbHL81Xr2KpDj2DN/15nRmxEGGpnhzQV44HZg/W93EaUqTyF+NCtStPCbpOKno0s89rYRXMosuP+1odpNcSouVqWscEZSNCIg1NTTLY0N8T51pX1g8Lw9Qz80OMRnn8D83mVvNNqLJx5vQ8THz96/L77Syih6a5Qr0AyE7hGcbNrfG+3LvomHDARQ9Tv2KqDcrkiTdh7NtXYiQogxdWYx9OzTUOau4z8K5tr9lLlqFa6WYkFFaoc/+49IFAkgoUXg65gTYUMkP76xu/MC0XEOTU2+jvXLyyTpacD7nWRcbrI8XG7oCvT3BUc/boe4DSIqCwgaffqDVxld+dnVju2xKHedRC/OwhKXMnrBqFSlF2OTn67yFjxeq5DKxzyfwBKv9ia9FPqADSPTqaRJuE4eydM6u4cTdU1+8yQJNaPk0NRMmhksH2vscwaAdxX3kyUxi7DrS8qxpg1FZCA34YSmXyk88Ov8ZNPBL82xI=
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"json.schemas": [
|
||||
{
|
||||
"fileMatch": ["/npmextra.json"],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"npmci": {
|
||||
"type": "object",
|
||||
"description": "settings for npmci"
|
||||
},
|
||||
"gitzone": {
|
||||
"type": "object",
|
||||
"description": "settings for gitzone",
|
||||
"properties": {
|
||||
"projectType": {
|
||||
"type": "string",
|
||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
63
README.md
63
README.md
@ -1,63 +0,0 @@
|
||||
# beautylog
|
||||
beautiful logging
|
||||
|
||||
## Status
|
||||
[](https://travis-ci.org/pushrocks/beautylog)
|
||||
[](https://david-dm.org/pushrocks/beautylog)
|
||||
[](https://www.bithound.io/github/pushrocks/beautylog/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/beautylog)
|
||||
[](https://coveralls.io/github/pushrocks/beautylog?branch=greenkeeper-npmts-2.1.10)
|
||||
|
||||
## Usage
|
||||
```javascript
|
||||
|
||||
### Simple Logging
|
||||
var bl = require('beautylog'); //for use in OS console environment AND browser console
|
||||
|
||||
|
||||
bl.log('some log message'); //normal console log message
|
||||
bl.success('some success message'); //success console log message
|
||||
bl.error('some error message'); //error console log message
|
||||
|
||||
//alternatively you can use a logType parameter
|
||||
bl.log('some log message','normal');
|
||||
bl.log('some success message','success');
|
||||
bl.log('some error message','error');
|
||||
```
|
||||
The plugin produces beautiful output like this:
|
||||

|
||||
|
||||
### Code Highlighting
|
||||
|
||||
|
||||
|
||||
### Console Tables
|
||||
beautylog allows displaying data in nice tables for better overview.
|
||||
|
||||
There are different types of tables.
|
||||
|
||||
#### Custom
|
||||
|
||||
```javascript
|
||||
var bl = require('beautylog')("os"); //for use in OS console environment
|
||||
var myTable = bl.table.new("custom",["Heading1".blue,"Heading2".blue,"Heading3".blue]); // type "custom"
|
||||
myTable.push(["check 1","success"]); // adds a row the myTable
|
||||
myTable.push(["check 2","error"]); // adds a row the myTable
|
||||
myTable.push(["check 3","error"]); // adds a row the myTable
|
||||
myTable.print(); //prints myTable to the console
|
||||
```
|
||||
|
||||
#### Checks
|
||||
|
||||
```javascript
|
||||
var bl = require('beautylog')("os"); //for use in OS console environment
|
||||
var myTable = bl.table.new("checks"); // type checks
|
||||
myTable.push(["check 1","success"]); // adds a row the myTable
|
||||
myTable.push(["check 2","error"]); // adds a row the myTable
|
||||
myTable.push(["check 3","error"]); // adds a row the myTable
|
||||
myTable.print(); //prints myTable to the console
|
||||
```
|
||||
|
||||
The table from the code with type "checks" above looks like this:
|
||||

|
||||
|
120
code.css
120
code.css
@ -1,120 +0,0 @@
|
||||
.hljs {
|
||||
display: block;
|
||||
padding: 0.5em;
|
||||
color: #333;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-template_comment,
|
||||
.diff .hljs-header,
|
||||
.hljs-javadoc {
|
||||
color: #998;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.css .rule .hljs-keyword,
|
||||
.hljs-winutils,
|
||||
.javascript .hljs-title,
|
||||
.nginx .hljs-title,
|
||||
.hljs-subst,
|
||||
.hljs-request,
|
||||
.hljs-status {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-number,
|
||||
.hljs-hexcolor,
|
||||
.ruby .hljs-constant {
|
||||
color: #099;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-tag .hljs-value,
|
||||
.hljs-phpdoc,
|
||||
.tex .hljs-formula {
|
||||
color: #d14;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-id,
|
||||
.coffeescript .hljs-params,
|
||||
.scss .hljs-preprocessor {
|
||||
color: #900;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.javascript .hljs-title,
|
||||
.lisp .hljs-title,
|
||||
.clojure .hljs-title,
|
||||
.hljs-subst {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-class .hljs-title,
|
||||
.haskell .hljs-type,
|
||||
.vhdl .hljs-literal,
|
||||
.tex .hljs-command {
|
||||
color: #458;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-tag,
|
||||
.hljs-tag .hljs-title,
|
||||
.hljs-rules .hljs-property,
|
||||
.django .hljs-tag .hljs-keyword {
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-attribute,
|
||||
.hljs-variable,
|
||||
.lisp .hljs-body {
|
||||
color: #008080;
|
||||
}
|
||||
|
||||
.hljs-regexp {
|
||||
color: #009926;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.ruby .hljs-symbol .hljs-string,
|
||||
.lisp .hljs-keyword,
|
||||
.tex .hljs-special,
|
||||
.hljs-prompt {
|
||||
color: #990073;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.lisp .hljs-title,
|
||||
.clojure .hljs-built_in {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-preprocessor,
|
||||
.hljs-pragma,
|
||||
.hljs-pi,
|
||||
.hljs-doctype,
|
||||
.hljs-shebang,
|
||||
.hljs-cdata {
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background: #fdd;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background: #dfd;
|
||||
}
|
||||
|
||||
.diff .hljs-change {
|
||||
background: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-chunk {
|
||||
color: #aaa;
|
||||
}
|
18
dist/beautylog.browser.js
vendored
18
dist/beautylog.browser.js
vendored
@ -1,18 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
exports.log = function (message) {
|
||||
console.log('%c Log: %c ' + message, "background:#42A5F5;color:#ffffff", "color:#42A5F5;");
|
||||
};
|
||||
exports.info = function (message) {
|
||||
console.log('%c Info: %c ' + message, 'background:#EC407A;color:#ffffff;', 'color:#EC407A;');
|
||||
};
|
||||
exports.ok = function (message) {
|
||||
console.log('%c OK: %c ' + message, "background:#000000;color:#8BC34A;", "color:#000000;");
|
||||
};
|
||||
exports.success = function (message) {
|
||||
console.log('%c Success: %c ' + message, "background:#8BC34A;color:#ffffff;", "color:#8BC34A;");
|
||||
};
|
||||
exports.warn = function (message) {
|
||||
console.log('%c Warn: %c ' + message, "background:#000000;color:#FB8C00;", "color:#000000;");
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5icm93c2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUVqQyxXQUFHLEdBQUcsVUFBUyxPQUFPO0lBQzdCLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxHQUFHLE9BQU8sRUFBQyxrQ0FBa0MsRUFBQyxnQkFBZ0IsQ0FBQyxDQUFDO0FBQzdGLENBQUMsQ0FBQztBQUNTLFlBQUksR0FBRyxVQUFTLE9BQU87SUFDOUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxjQUFjLEdBQUcsT0FBTyxFQUFDLG1DQUFtQyxFQUFDLGdCQUFnQixDQUFDLENBQUM7QUFDL0YsQ0FBQyxDQUFDO0FBQ1MsVUFBRSxHQUFHLFVBQVMsT0FBTztJQUM1QixPQUFPLENBQUMsR0FBRyxDQUFDLFlBQVksR0FBRyxPQUFPLEVBQUMsbUNBQW1DLEVBQUMsZ0JBQWdCLENBQUMsQ0FBQztBQUM3RixDQUFDLENBQUM7QUFDUyxlQUFPLEdBQUcsVUFBUyxPQUFPO0lBQ2pDLE9BQU8sQ0FBQyxHQUFHLENBQUMsaUJBQWlCLEdBQUcsT0FBTyxFQUFDLG1DQUFtQyxFQUFDLGdCQUFnQixDQUFDLENBQUM7QUFDbEcsQ0FBQyxDQUFDO0FBQ1MsWUFBSSxHQUFHLFVBQVMsT0F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NvbnNvbGUubG9nKCclYyBXYXJuOiAlYyAnICsgbWVzc2FnZSxcImJhY2tncm91bmQ6IzAwMDAwMDtjb2xvcjojRkI4QzAwO1wiLFwiY29sb3I6IzAwMDAwMDtcIik7XG59OyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
53
dist/beautylog.classes.js
vendored
53
dist/beautylog.classes.js
vendored
File diff suppressed because one or more lines are too long
19
dist/beautylog.node.code.js
vendored
19
dist/beautylog.node.code.js
vendored
@ -1,19 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./beautylog.plugins");
|
||||
var codeFunction = function (codeString, options) {
|
||||
var codeSnippet = {
|
||||
source: codeString,
|
||||
highlighted: "default"
|
||||
};
|
||||
if (typeof codeString != "string") {
|
||||
console.log("beautylog.code() expects a string as first argument!");
|
||||
return;
|
||||
}
|
||||
;
|
||||
if (typeof options != "undefined") {
|
||||
codeSnippet.highlighted = plugins.hlight(codeSnippet.source, options.language);
|
||||
}
|
||||
};
|
||||
module.exports = codeFunction;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLmNvZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBRTVDLElBQU8sT0FBTyxXQUFXLHFCQUFxQixDQUFDLENBQUM7QUFDaEQsSUFBSSxZQUFZLEdBQUcsVUFBUyxVQUFVLEVBQUMsT0FBUTtJQUMzQyxJQUFJLFdBQVcsR0FBRztRQUNkLE1BQU0sRUFBQyxVQUFVO1FBQ2pCLFdBQVcsRUFBQyxTQUFTO0tBQ3hCLENBQUM7SUFDRixFQUFFLENBQUMsQ0FBQyxPQUFPLFVBQVUsSUFBSSxRQUFRLENBQUMsQ0FBQSxDQUFDO1FBQy9CLE9BQU8sQ0FBQyxHQUFHLENBQUMsc0RBQXNELENBQUMsQ0FBQztRQUNwRSxNQ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ICAgIC8vY29uc29sZS5sb2coY29kZVNuaXBwZXQuaGlnaGxpZ2h0ZWQpXG4gICAgfVxufTtcbmV4cG9ydCA9IGNvZGVGdW5jdGlvbjsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
39
dist/beautylog.node.figlet.js
vendored
39
dist/beautylog.node.figlet.js
vendored
@ -1,39 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./beautylog.plugins");
|
||||
var defaultOptions = {
|
||||
font: "Star Wars",
|
||||
color: "green",
|
||||
cb: function () { }
|
||||
};
|
||||
exports.figlet = function (textArg, optionsArg) {
|
||||
var done = plugins.q.defer();
|
||||
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
|
||||
var options = plugins.lodash.assign(mergeOptions, optionsArg);
|
||||
plugins.figlet(textArg, {
|
||||
font: options.font,
|
||||
horizontalLayout: 'default',
|
||||
verticalLayout: 'default'
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
console.log('Something went wrong...');
|
||||
console.dir(err);
|
||||
return;
|
||||
}
|
||||
console.log(data[options.color]);
|
||||
options.cb();
|
||||
done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
};
|
||||
exports.figletSync = function (textArg, optionsArg) {
|
||||
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
|
||||
var options = plugins.lodash.assign(mergeOptions, optionsArg);
|
||||
console.log(plugins.figlet.textSync(textArg, {
|
||||
font: options.font,
|
||||
horizontalLayout: 'default',
|
||||
verticalLayout: 'default'
|
||||
})[options.color]);
|
||||
return true;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLmZpZ2xldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcscUJBQXFCLENBQUMsQ0FBQztBQUNoRCxJQ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mb250OiBvcHRpb25zLmZvbnQsXG4gICAgICAgIGhvcml6b250YWxMYXlvdXQ6ICdkZWZhdWx0JyxcbiAgICAgICAgdmVydGljYWxMYXlvdXQ6ICdkZWZhdWx0J1xuICAgIH0pW29wdGlvbnMuY29sb3JdKTtcbiAgICByZXR1cm4gdHJ1ZTtcbn07XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
57
dist/beautylog.node.js
vendored
57
dist/beautylog.node.js
vendored
@ -1,57 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
exports.log = require("./beautylog.node.log");
|
||||
exports.table = require("./beautylog.node.table");
|
||||
exports.code = require("./beautylog.node.code");
|
||||
var figletModule = require("./beautylog.node.figlet");
|
||||
exports.figlet = figletModule.figlet;
|
||||
exports.figletSync = figletModule.figletSync;
|
||||
/**
|
||||
* logs an directory to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.dir = function (logText) {
|
||||
return exports.log(logText, 'dir');
|
||||
};
|
||||
/**
|
||||
* logs an error to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.error = function (logText) {
|
||||
return exports.log(logText, 'error');
|
||||
};
|
||||
/**
|
||||
* logs an info to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.info = function (logText) {
|
||||
return exports.log(logText, 'info');
|
||||
};
|
||||
/**
|
||||
* logs an 'OK!' message to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.ok = function (logText) {
|
||||
return exports.log(logText, 'ok');
|
||||
};
|
||||
/**
|
||||
* logs a success to console
|
||||
* @param logText string to log as error
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.success = function (logText) {
|
||||
return exports.log(logText, 'success');
|
||||
};
|
||||
/**
|
||||
* logs a 'warn:' message to console
|
||||
* @param logText string to log as error
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.warn = function (logText) {
|
||||
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yJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
60
dist/beautylog.node.log.js
vendored
60
dist/beautylog.node.log.js
vendored
File diff suppressed because one or more lines are too long
10
dist/beautylog.node.table.js
vendored
10
dist/beautylog.node.table.js
vendored
@ -1,10 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var classes = require("./beautylog.classes");
|
||||
var beautylogOsTable = {};
|
||||
beautylogOsTable.new = function (typeArg, tableHeadArrayArg) {
|
||||
var newConsoleTable = new classes.ConsoleTable(typeArg, tableHeadArrayArg);
|
||||
return newConsoleTable;
|
||||
};
|
||||
module.exports = beautylogOsTable;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLnRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxxQkFBcUIsQ0FBQyxDQUFDO0FBRWhELElBQUksZ0JBQWdCLEdBQU8sRUFBRSxDQUFDO0FBRTlCLGdCQUFnQixDQUFDLEdBQUcsR0FBRyxVQUFTLE9BQWMsRUFBQyxpQkFBa0I7SUFDN0QsSUFBSSxlQUFlLEdBQUcsSUFBSSxPQUFPLENBQUMsWUFBWSxDQUFDLE9BQU8sRUFBQyxpQkFBaUIsQ0FBQyxDQUFDO0lBQzFFLE1BQU0sQ0FBQyxlQUFlLENBQUM7QUFDM0IsQ0FBQyxDQUFDO0FBQ0YsaUJBQVMsZ0JBQWdCLENBQUMiLCJmaWxlIjoiYmVhdXR5bG9nLm5vZGUudGFibGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgY2xhc3NlcyA9IHJlcXVpcmUoXCIuL2JlYXV0eWxvZy5jbGFzc2VzXCIpO1xuXG52YXIgYmVhdXR5bG9nT3NUYWJsZTphbnkgPSB7fTtcblxuYmVhdXR5bG9nT3NUYWJsZS5uZXcgPSBmdW5jdGlvbih0eXBlQXJnOnN0cmluZyx0YWJsZUhlYWRBcnJheUFyZz8pIHtcbiAgICB2YXIgbmV3Q29uc29sZVRhYmxlID0gbmV3IGNsYXNzZXMuQ29uc29sZVRhYmxlKHR5cGVBcmcsdGFibGVIZWFkQXJyYXlBcmcpO1xuICAgIHJldHVybiBuZXdDb25zb2xlVGFibGU7XG59O1xuZXhwb3J0ID0gYmVhdXR5bG9nT3NUYWJsZTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
18
dist/beautylog.plugins.js
vendored
18
dist/beautylog.plugins.js
vendored
@ -1,18 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
lodash: require("lodash"),
|
||||
smartenv: require("smartenv"),
|
||||
q: require("q")
|
||||
};
|
||||
if (plugins.smartenv.getEnv().isNode) {
|
||||
plugins = plugins.lodash.assign(plugins, {
|
||||
cliTable: require("cli-table2"),
|
||||
colors: require("colors"),
|
||||
clc: require("cli-color"),
|
||||
figlet: require("figlet"),
|
||||
hlight: require("hlight")
|
||||
});
|
||||
}
|
||||
module.exports = plugins;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUU1QyxJQUFJLE9BQU8sR0FBTztJQUNkLE1BQU0sRUFBRSxPQUFPLENBQUMsUUFBUSxDQUFDO0lBQ3pCLFFBQVEsRUFBRSxPQUFPLENBQUMsVUFBVSxDQUFDO0lBQzdCLENBQUMsRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDO0NBQ2xCLENBQUM7QUFDRixFQUFFLENBQUMsQ0FBQyxPQUFPLENBQUMsUUFBUSxD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lyZShcImhsaWdodFwiKVxuICAgIH0pO1xufVxuZXhwb3J0ID0gcGx1Z2luczsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
3
dist/beautylog.promisechain.js
vendored
3
dist/beautylog.promisechain.js
vendored
@ -1,3 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5wcm9taXNlY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDIiwiZmlsZSI6ImJlYXV0eWxvZy5wcm9taXNlY2hhaW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
19
dist/index.js
vendored
19
dist/index.js
vendored
@ -1,19 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./beautylog.plugins");
|
||||
var BeautylogNode = require("./beautylog.node");
|
||||
var BeautylogBrowser = require("./beautylog.browser");
|
||||
var beautylog;
|
||||
switch (plugins.smartenv.getEnv().runtimeEnv) {
|
||||
case "node":
|
||||
beautylog = BeautylogNode;
|
||||
break;
|
||||
case "browser":
|
||||
beautylog = BeautylogBrowser;
|
||||
break;
|
||||
default:
|
||||
console.log("something is strange about the platform in which you try to use beautylog");
|
||||
break;
|
||||
}
|
||||
module.exports = beautylog;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUU1QyxJQUFPLE9BQU8sV0FBVyxxQkFBcUIsQ0FBQyxDQUFDO0FBQ2hELElBQU8sYUFBYSxXQUFXLGtCQUFrQ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gQmVhdXR5bG9nQnJvd3NlcjtcbiAgICAgICAgYnJlYWs7XG4gICAgZGVmYXVsdDpcbiAgICAgICAgY29uc29sZS5sb2coXCJzb21ldGhpbmcgaXMgc3RyYW5nZSBhYm91dCB0aGUgcGxhdGZvcm0gaW4gd2hpY2ggeW91IHRyeSB0byB1c2UgYmVhdXR5bG9nXCIpO1xuICAgICAgICBicmVhaztcbn1cblxuZXhwb3J0ID0gYmVhdXR5bG9nO1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
19
dist/testbrowser.js
vendored
19
dist/testbrowser.js
vendored
@ -1,19 +0,0 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var plugins = {
|
||||
gulp: require("gulp"),
|
||||
gulpBrowser: require("gulp-browser"),
|
||||
easyserve: require("easyserve")
|
||||
};
|
||||
plugins.gulp.task('compileBrowserJS', function () {
|
||||
var stream = plugins.gulp.src('test/browser/index.js')
|
||||
.pipe(plugins.gulpBrowser.browserify())
|
||||
.pipe(plugins.gulp.dest("test/browser/browserified/"));
|
||||
return stream;
|
||||
});
|
||||
plugins.gulp.task('default', ['compileBrowserJS'], function () {
|
||||
console.log('browserJS has been browserified');
|
||||
plugins.easyserve("test/browser/");
|
||||
});
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3Ricm93c2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlDQUF5QztBQUN6QyxJQUFJLE9BQU8sR0FBRztJQUNWLElBQUksRUFBRSxPQUFPLENBQUMsTUFBTSxDQUFDO0lBQ3JCLFdBQVcsRUFBRSxPQUFPLENBQUMsY0FBYyxDQUFDO0lBQ3BDLFNBQVMsRUFBRSxPQUFPLENBQUMsV0FBVyxDQUFDO0NBQ2xDLENBQUM7QUFFRixPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ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gIHZhciBzdHJlYW0gPSBwbHVnaW5zLmd1bHAuc3JjKCd0ZXN0L2Jyb3dzZXIvaW5kZXguanMnKVxuICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBCcm93c2VyLmJyb3dzZXJpZnkoKSlcbiAgICAgICAgLnBpcGUocGx1Z2lucy5ndWxwLmRlc3QoXCJ0ZXN0L2Jyb3dzZXIvYnJvd3NlcmlmaWVkL1wiKSk7XG4gICAgcmV0dXJuIHN0cmVhbTtcbn0pO1xuXG5wbHVnaW5zLmd1bHAudGFzaygnZGVmYXVsdCcsWydjb21waWxlQnJvd3NlckpTJ10sIGZ1bmN0aW9uKCkge1xuICAgIGNvbnNvbGUubG9nKCdicm93c2VySlMgaGFzIGJlZW4gYnJvd3NlcmlmaWVkJyk7XG4gICAgcGx1Z2lucy5lYXN5c2VydmUoXCJ0ZXN0L2Jyb3dzZXIvXCIpO1xufSk7XG5cbnBsdWdpbnMuZ3VscC5zdGFydC5hcHBseShwbHVnaW5zLmd1bHAsIFsnZGVmYXVsdCddKTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
74
docs/index.md
Normal file
74
docs/index.md
Normal file
@ -0,0 +1,74 @@
|
||||
# beautylog
|
||||
|
||||
beautiful logging, TypeScript ready
|
||||
|
||||
## Availabililty
|
||||
|
||||
[](https://www.npmjs.com/package/beautylog)
|
||||
[](https://GitLab.com/pushrocks/beautylog)
|
||||
[](https://github.com/pushrocks/beautylog)
|
||||
[](https://pushrocks.gitlab.io/beautylog/)
|
||||
|
||||
## Status for master
|
||||
|
||||
[](https://GitLab.com/pushrocks/beautylog/commits/master)
|
||||
[](https://GitLab.com/pushrocks/beautylog/commits/master)
|
||||
[](https://www.npmjs.com/package/beautylog)
|
||||
[](https://david-dm.org/pushrocks/beautylog)
|
||||
[](https://www.bithound.io/github/pushrocks/beautylog/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/beautylog)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Quick Demo
|
||||
|
||||
[](https://asciinema.org/a/46djsde96ecsho9wqibjx2zye)
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
```javascript
|
||||
beautylog.log('some log message'); // normal console log message
|
||||
beautylog.info('some log message'); // info console log message
|
||||
beautylog.ok('some log message'); // ok console log message
|
||||
beautylog.warn('some log message'); // warn console log message
|
||||
beautylog.success('some success message'); // success console log message
|
||||
beautylog.error('some error message'); // error console log message
|
||||
```
|
||||
|
||||
### Ora Integration
|
||||
|
||||
beautylog wraps the excellent ora module from npm to better work with beautylog. In general that means that you can log persistent messages WHILE you are actually having an active Ora object. beautylog handles all the fuss for you.
|
||||
|
||||
```javascript
|
||||
beautylog.ora.start('Hi, this is some text!', 'blue');
|
||||
beautylog.info('some persistent text'); //does not disturb ora
|
||||
console.log('something'); // even this works because console.log is monkeypatched by beautylog
|
||||
beautylog.ora.text('some updated text'); // switches the text
|
||||
beautylog.ora.stop();
|
||||
```
|
||||
|
||||
## Centralized remote logging
|
||||
|
||||
Beautylog makes it easy to have all your node applications log to a remote location.
|
||||
|
||||
```javascript
|
||||
import { Loggly } from 'beautyremote';
|
||||
let myLogglyRemote = new Loggly({
|
||||
token: 'my_super_long_token_here',
|
||||
});
|
||||
beautylog.registerRemote(myLogglyRemote);
|
||||
```
|
||||
|
||||
> Note: Beautylog monkeypatches all console log methods.
|
||||
> There is no need to change anything in your code.
|
||||
> Everything that is getting logged to your console by node will get logged to a remote as well.
|
||||
|
||||
For further information read the linked docs at the top of this README.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://push.rocks)
|
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Push.Rocks
|
||||
Copyright (c) 2015 Lossless GmbH
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
28
npmextra.json
Normal file
28
npmextra.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"npmci": {
|
||||
"globalNpmTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartlog-destination-local",
|
||||
"description": "a smartlog destination targeting the local console",
|
||||
"npmPackagename": "@push.rocks/smartlog-destination-local",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"console log",
|
||||
"log management",
|
||||
"developer tools",
|
||||
"local logging",
|
||||
"console output"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"mode":"default",
|
||||
"coveralls":true
|
||||
}
|
79
package.json
79
package.json
@ -1,48 +1,59 @@
|
||||
{
|
||||
"name": "beautylog",
|
||||
"version": "3.1.2",
|
||||
"description": "beautiful logging",
|
||||
"main": "dist/index.js",
|
||||
"name": "@push.rocks/smartlog-destination-local",
|
||||
"private": false,
|
||||
"version": "9.0.2",
|
||||
"description": "a smartlog destination targeting the local console",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)",
|
||||
"testbrowser": "(npm test) && (node testbrowser.js)",
|
||||
"gitsetup": "(git config push.followTags true)",
|
||||
"push": "(git push origin master && git push origin release && git push --follow-tags)",
|
||||
"reinstall": "(rm -r node_modules && npm install)",
|
||||
"release": "(npm test) && (git pull origin master && npm version patch && git checkout release && git merge master && git checkout master && npm run push)",
|
||||
"update": "(git checkout master && git pull origin master) && (npm install)",
|
||||
"upgrade": "(npm run update) && (ncu upgradeAll && npm install)"
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild --web)",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pushrocks/beautylog.git"
|
||||
"url": "https://code.foss.global/push.rocks/smartlog-destination-local.git"
|
||||
},
|
||||
"keywords": [
|
||||
"log",
|
||||
"color",
|
||||
"console",
|
||||
"beautiful"
|
||||
"logging",
|
||||
"console log",
|
||||
"log management",
|
||||
"developer tools",
|
||||
"local logging",
|
||||
"console output"
|
||||
],
|
||||
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
||||
"author": "Lossless GmbH <hello@lossless.com> (https://lossless.com)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pushrocks/beautylog/issues"
|
||||
"url": "https://gitlab.com/pushrocks/beautylog/issues"
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/beautylog",
|
||||
"homepage": "https://code.foss.global/push.rocks/smartlog-destination-local",
|
||||
"dependencies": {
|
||||
"cli-color": "^1.1.0",
|
||||
"cli-table2": "^0.2.0",
|
||||
"colors": "1.1.2",
|
||||
"figlet": "^1.1.1",
|
||||
"hlight": "0.0.8",
|
||||
"lodash": "^4.5.1",
|
||||
"q": "^1.4.1",
|
||||
"smartenv": "1.0.10"
|
||||
"@push.rocks/consolecolor": "^2.0.1",
|
||||
"@push.rocks/smartlog-interfaces": "^3.0.0",
|
||||
"@push.rocks/smartpromise": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"easyserve": "0.0.5",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-browser": "1.0.10",
|
||||
"npmts": "3.1.2"
|
||||
}
|
||||
}
|
||||
"@git.zone/tsbuild": "^2.1.66",
|
||||
"@git.zone/tsrun": "^1.2.42",
|
||||
"@git.zone/tstest": "^1.0.74",
|
||||
"@push.rocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.4.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_*/**/*",
|
||||
"dist_ts/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"type": "module",
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
}
|
5009
pnpm-lock.yaml
generated
Normal file
5009
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
||||
|
111
readme.md
Normal file
111
readme.md
Normal file
@ -0,0 +1,111 @@
|
||||
# @push.rocks/smartlog-destination-local
|
||||
a smartlog destination targeting the local console
|
||||
|
||||
## Install
|
||||
To use `@push.rocks/smartlog-destination-local` in your project, you need to install it via npm. You can do this by running:
|
||||
|
||||
```bash
|
||||
npm install @push.rocks/smartlog-destination-local --save
|
||||
```
|
||||
|
||||
This command adds `@push.rocks/smartlog-destination-local` to your project's dependencies and enables you to start implementing its features in your application.
|
||||
|
||||
## Usage
|
||||
|
||||
The `@push.rocks/smartlog-destination-local` package provides a way to easily log messages to the local console with support for color coding and structured message formats. It is especially useful when combined with the `@push.rocks/smartlog` package to create a powerful logging solution that is both visually informative and structured for better logging practices.
|
||||
|
||||
### Importing and Setting Up
|
||||
|
||||
First, make sure to import the package where you intend to use it:
|
||||
|
||||
```typescript
|
||||
import { DestinationLocal } from '@push.rocks/smartlog-destination-local';
|
||||
```
|
||||
|
||||
Next, create an instance of `DestinationLocal`:
|
||||
|
||||
```typescript
|
||||
const localLogDestination = new DestinationLocal();
|
||||
```
|
||||
|
||||
### Logging Messages
|
||||
|
||||
The primary feature of `@push.rocks/smartlog-destination-local` is to log messages to the console. This can be done by preparing a log package and using the `handleLog` method.
|
||||
|
||||
#### Example Log Message
|
||||
|
||||
```typescript
|
||||
import type { ILogPackage } from '@push.rocks/smartlog-interfaces';
|
||||
|
||||
const logPackage: ILogPackage = {
|
||||
timestamp: Date.now(),
|
||||
type: 'log', // or 'error', 'warn', etc. depending on the nature of the message
|
||||
level: 'info', // determines the visibility and importance of the log
|
||||
context: {
|
||||
company: 'Your Company',
|
||||
companyunit: 'Your Unit',
|
||||
containerName: 'Your Container',
|
||||
environment: 'development',
|
||||
runtime: 'node',
|
||||
zone: 'Your Zone'
|
||||
},
|
||||
message: 'This is a test log message.', // the actual message
|
||||
correlation: {
|
||||
id: 'uniqueId', // useful for tracing logs
|
||||
type: 'requestId'
|
||||
},
|
||||
};
|
||||
|
||||
// Using the instance to log the message
|
||||
localLogDestination.handleLog(logPackage);
|
||||
```
|
||||
|
||||
This will output a structured, color-coded log message to your console, making it easier to differentiate between various log levels and to understand the context of the log messages at a glance.
|
||||
|
||||
### Log Reduction
|
||||
|
||||
For scenarios where repeated log messages may clutter your log output, `@push.rocks/smartlog-destination-local` offers a `logReduced` method. This method will throttle the output of identical consecutive messages according to the settings you provide.
|
||||
|
||||
#### Reducing Log Output
|
||||
|
||||
```typescript
|
||||
// Log a message repeatedly, e.g., in a loop
|
||||
for (let i = 0; i < 100; i++) {
|
||||
localLogDestination.logReduced('Repeated message', 5); // only logs every 5th identical message
|
||||
}
|
||||
```
|
||||
|
||||
### Adding New Lines
|
||||
|
||||
You may want to improve the readability of your logs by inserting blank lines. This can be easily achieved:
|
||||
|
||||
```typescript
|
||||
localLogDestination.newLine(2); // Inserts two empty lines in the log output
|
||||
```
|
||||
|
||||
### Advanced Use Cases
|
||||
|
||||
The `@push.rocks/smartlog-destination-local` package is flexible and integrates seamlessly with other logging and monitoring solutions. It can be extended or customized to fit more complex logging requirements, such as filtering logs based on environment, enhancing log messages with additional metadata, or integrating with remote logging services for centralized log management.
|
||||
|
||||
### Conclusion
|
||||
|
||||
`@push.rocks/smartlog-destination-local` serves as a robust, easy-to-use solution for enhancing your application's logging capabilities. By following the examples and using the provided methods, you can quickly implement effective logging practices that improve debugging, monitoring, and analysis of your application's behavior in development and production environments.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
<head>
|
||||
<script async src="browserified/index.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
@ -1,4 +0,0 @@
|
||||
var beautylog = require("./index.js");
|
||||
console.log("*** start browser console test (Might look weird in OS console and travis log...) ***");
|
||||
beautylog.log("hello");
|
||||
console.log("*** end browser console test ***");
|
83
test/test.js
83
test/test.js
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACnC,IAAI,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE5C,QAAQ,CAAC,WAAW,EAAC;IACjB,QAAQ,CAAC,uBAAuB,EAAC;QAC7B,EAAE,CAAC,sBAAsB,EAAC;YACtB,SAAS,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,uDAAuD,EAAC;YACvD,SAAS,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;YACvE,SAAS,CAAC,GAAG,CAAC,0DAA0D,EAAC,KAAK,CAAC,CAAC;YAChF,SAAS,CAAC,GAAG,CAAC,4DAA4D,EAAC,OAAO,CAAC,CAAC;YACpF,SAAS,CAAC,GAAG,CAAC,2DAA2D,EAAC,MAAM,CAAC,CAAC;YAClF,SAAS,CAAC,GAAG,CAAC,yDAAyD,EAAC,IAAI,CAAC,CAAC;YAC9E,SAAS,CAAC,GAAG,CAAC,8DAA8D,EAAC,SAAS,CAAC,CAAC;YACxF,SAAS,CAAC,GAAG,CAAC,2DAA2D,EAAC,MAAM,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,eAAe,EAAC;Q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CAAC"}
|
127
test/test.ts
127
test/test.ts
@ -1,88 +1,49 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var smartenv = require("smartenv");
|
||||
var beautylog = require('../dist/index.js');
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
|
||||
describe("beautylog",function(){
|
||||
describe(".log(message,logtype)",function(){
|
||||
it("should log cyan text",function(){
|
||||
beautylog.log('beautylog.log(), with normal logText, without logType');
|
||||
});
|
||||
it("should print different log types dependent on logType",function(){
|
||||
beautylog.log('beautylog.log(), with normal logText, without logType');
|
||||
beautylog.log('beautylog.log(), with normal logText, with logType "dir"','dir');
|
||||
beautylog.log('beautylog.log(), with normal logText, with logType "error"','error');
|
||||
beautylog.log('beautylog.log(), with normal logText, with logType "info"','info');
|
||||
beautylog.log('beautylog.log(), with normal logText, with logType "ok"','ok');
|
||||
beautylog.log('beautylog.log(), with normal logText, with logType "success"','success');
|
||||
beautylog.log('beautylog.log(), with normal logText, with logType "warn"','warn');
|
||||
});
|
||||
});
|
||||
describe(".dir(message)",function(){
|
||||
it("should print a blue Dir message",function(){
|
||||
beautylog.dir('beautylog.dir(), with normal logText, without logType');
|
||||
})
|
||||
})
|
||||
describe(".error(message)",function(){
|
||||
it("should print a red error message",function(){
|
||||
beautylog.error('beautylog.error(), with normal logText, without logType');
|
||||
});
|
||||
});
|
||||
describe(".info(message)",function(){
|
||||
it("should display a purple info message",function(){
|
||||
beautylog.info('beautylog.dir(), with normal logText, without logType');
|
||||
});
|
||||
});
|
||||
describe(".ok(message)",function(){
|
||||
it("should display a green ok message",function(){
|
||||
beautylog.ok('beautylog.ok(), with normal logText, without logType');
|
||||
});
|
||||
});
|
||||
describe(".success(message)",function(){
|
||||
it("should display an orange warn message",function(){
|
||||
beautylog.success('beautylog.success(), with normal logText, without logType');
|
||||
})
|
||||
});
|
||||
describe(".warn",function(){
|
||||
it("should display a orange warn message",function(){
|
||||
beautylog.warn('beautylog.warn(), with normal logText, without logType');
|
||||
});
|
||||
});
|
||||
describe(".table",function(){
|
||||
it("should print a nice table",function(){
|
||||
(function(){
|
||||
var testTable1 = beautylog.table.new("checks");
|
||||
testTable1.push(['check1','success']);
|
||||
testTable1.push(['check2','error']);
|
||||
testTable1.push(['check3','error']);
|
||||
testTable1.print();
|
||||
import * as smartlogDesinationLocal from '../ts/index.js';
|
||||
import type { ILogContext } from '@push.rocks/smartlog-interfaces';
|
||||
|
||||
var testTable2 = beautylog.table.new("custom",["Column1".red,"Column2".blue,"Column3".cyan]);
|
||||
testTable2.push(["Hey","this","works"]);
|
||||
testTable2.print();
|
||||
})();
|
||||
});
|
||||
});
|
||||
describe(".figlet",function(){
|
||||
it("should print nice fonts to console in yellow",function(done){
|
||||
beautylog.figlet("Async!",{font:"Star Wars",color:"yellow"}).then(done);
|
||||
})
|
||||
});
|
||||
describe(".figletSync",function(){
|
||||
it("should print nice fonts to console in yellow",function(){
|
||||
beautylog.figletSync("Sync!",{font:"Star Wars",color:"blue"});
|
||||
})
|
||||
});
|
||||
describe(".code",function(){
|
||||
it("should highlight code",function(){
|
||||
this.timeout(10000);
|
||||
beautylog.code(
|
||||
"var test = 3;\nfunction(){\n var hello = \"super\"\n};\nvar test;",
|
||||
{
|
||||
language:"javascript"
|
||||
}
|
||||
);
|
||||
})
|
||||
})
|
||||
const testLogContext: ILogContext = {
|
||||
company: 'Lossless GmbH',
|
||||
companyunit: 'Lossless.Cloud',
|
||||
containerName: 'gitlabci',
|
||||
environment: 'staging',
|
||||
runtime: 'node',
|
||||
zone: 'shipzone',
|
||||
};
|
||||
|
||||
let testLocalInstance: smartlogDesinationLocal.DestinationLocal;
|
||||
|
||||
tap.test('should create a valid instance of DestinationLocal', async () => {
|
||||
testLocalInstance = new smartlogDesinationLocal.DestinationLocal();
|
||||
expect(testLocalInstance).toBeInstanceOf(smartlogDesinationLocal.DestinationLocal);
|
||||
});
|
||||
|
||||
tap.test('.log(message) should print a blue Dir message', async () => {
|
||||
testLocalInstance.handleLog({
|
||||
timestamp: Date.now(),
|
||||
type: 'log',
|
||||
level: 'info',
|
||||
context: testLogContext,
|
||||
message: 'this is a info log message',
|
||||
correlation: {
|
||||
id: '123',
|
||||
type: 'none',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
tap.test('.logReduced(message) should only log two messages', async () => {
|
||||
testLocalInstance.logReduced('Message 1');
|
||||
testLocalInstance.logReduced('Message 1');
|
||||
testLocalInstance.logReduced('Message 1');
|
||||
testLocalInstance.logReduced('Message 1');
|
||||
testLocalInstance.logReduced('Message 2');
|
||||
testLocalInstance.logReduced('Message 2');
|
||||
});
|
||||
|
||||
tap.test('.newLine(number) create specified amount of new lines', async () => {
|
||||
testLocalInstance.newLine(1);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -1,18 +0,0 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var plugins = {
|
||||
gulp: require("gulp"),
|
||||
gulpBrowser: require("gulp-browser"),
|
||||
easyserve: require("easyserve")
|
||||
};
|
||||
plugins.gulp.task('compileBrowserJS', function () {
|
||||
var stream = plugins.gulp.src('test/browser/index.js')
|
||||
.pipe(plugins.gulpBrowser.browserify())
|
||||
.pipe(plugins.gulp.dest("test/browser/browserified/"));
|
||||
return stream;
|
||||
});
|
||||
plugins.gulp.task('default', ['compileBrowserJS'], function () {
|
||||
console.log('browserJS has been browserified');
|
||||
plugins.easyserve("test/browser/");
|
||||
});
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||
//# sourceMappingURL=testbrowser.js.map
|
@ -1 +0,0 @@
|
||||
{"version":3,"file":"testbrowser.js","sourceRoot":"","sources":["testbrowser.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,IAAI,OAAO,GAAG;IACV,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC,cAAc,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC;CAClC,CAAC;AAEF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;IAClC,IAAI,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC;SACjD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;SACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAC3D,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,CAAC,kBAAkB,CAAC,EAAE;IAC9C,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
@ -1,20 +0,0 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var plugins = {
|
||||
gulp: require("gulp"),
|
||||
gulpBrowser: require("gulp-browser"),
|
||||
easyserve: require("easyserve")
|
||||
};
|
||||
|
||||
plugins.gulp.task('compileBrowserJS', function() {
|
||||
var stream = plugins.gulp.src('test/browser/index.js')
|
||||
.pipe(plugins.gulpBrowser.browserify())
|
||||
.pipe(plugins.gulp.dest("test/browser/browserified/"));
|
||||
return stream;
|
||||
});
|
||||
|
||||
plugins.gulp.task('default',['compileBrowserJS'], function() {
|
||||
console.log('browserJS has been browserified');
|
||||
plugins.easyserve("test/browser/");
|
||||
});
|
||||
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartlog-destination-local',
|
||||
version: '9.0.2',
|
||||
description: 'a smartlog destination targeting the local console'
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
export let log = function(message){
|
||||
console.log('%c Log: %c ' + message,"background:#42A5F5;color:#ffffff","color:#42A5F5;");
|
||||
};
|
||||
export let info = function(message){
|
||||
console.log('%c Info: %c ' + message,'background:#EC407A;color:#ffffff;','color:#EC407A;');
|
||||
};
|
||||
export let ok = function(message){
|
||||
console.log('%c OK: %c ' + message,"background:#000000;color:#8BC34A;","color:#000000;");
|
||||
};
|
||||
export let success = function(message){
|
||||
console.log('%c Success: %c ' + message,"background:#8BC34A;color:#ffffff;","color:#8BC34A;");
|
||||
};
|
||||
export let warn = function(message){
|
||||
console.log('%c Warn: %c ' + message,"background:#000000;color:#FB8C00;","color:#000000;");
|
||||
};
|
@ -1,49 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./beautylog.plugins");
|
||||
|
||||
var tableHelpers = {
|
||||
makeRow: function(cellCounterArg:number = 2,colorArg:string = "cyan"){
|
||||
var rowArray = [];
|
||||
for (var i = 0; i < (cellCounterArg); i++) {
|
||||
rowArray.push(String(i + 1).cyan);
|
||||
}
|
||||
return rowArray;
|
||||
}
|
||||
};
|
||||
|
||||
export class ConsoleTable {
|
||||
tableHead:string[];
|
||||
rows;
|
||||
type:string;
|
||||
constructor(tableTypeArg:string,tableHeadArrayArg:string[] = tableHelpers.makeRow()) {
|
||||
switch (tableTypeArg) {
|
||||
case "checks":
|
||||
this.tableHead = ['Check Item:'.cyan,'Status:'.cyan];
|
||||
break;
|
||||
case "custom":
|
||||
this.tableHead = tableHeadArrayArg;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.rows = [];
|
||||
this.type = tableTypeArg;
|
||||
}
|
||||
push(row:string[]){
|
||||
this.rows.push(row);
|
||||
}
|
||||
print() {
|
||||
var table = new plugins.cliTable({
|
||||
head: this.tableHead
|
||||
});
|
||||
for (var row in this.rows){
|
||||
if(this.rows[row][1] == "success"){
|
||||
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
|
||||
} else if (this.rows[row][1] == "error") {
|
||||
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
|
||||
}
|
||||
table.push(this.rows[row]);
|
||||
};
|
||||
console.log(table.toString());
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
import plugins = require("./beautylog.plugins");
|
||||
var codeFunction = function(codeString,options?){
|
||||
var codeSnippet = {
|
||||
source:codeString,
|
||||
highlighted:"default"
|
||||
};
|
||||
if (typeof codeString != "string"){
|
||||
console.log("beautylog.code() expects a string as first argument!");
|
||||
return;
|
||||
};
|
||||
if (typeof options != "undefined"){
|
||||
codeSnippet.highlighted = plugins.hlight(codeSnippet.source,options.language);
|
||||
//console.log(codeSnippet.highlighted)
|
||||
}
|
||||
};
|
||||
export = codeFunction;
|
@ -1,37 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./beautylog.plugins");
|
||||
var defaultOptions = {
|
||||
font:"Star Wars",
|
||||
color: "green",
|
||||
cb: function(){}
|
||||
};
|
||||
export var figlet = function(textArg:string,optionsArg?){
|
||||
var done = plugins.q.defer();
|
||||
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
|
||||
var options = plugins.lodash.assign(mergeOptions,optionsArg);
|
||||
plugins.figlet(textArg,{
|
||||
font: options.font,
|
||||
horizontalLayout: 'default',
|
||||
verticalLayout: 'default'
|
||||
}, function(err, data) {
|
||||
if (err) {
|
||||
console.log('Something went wrong...');
|
||||
console.dir(err);
|
||||
return;
|
||||
}
|
||||
console.log(data[options.color]);
|
||||
options.cb();
|
||||
done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
};
|
||||
export var figletSync = function(textArg:string,optionsArg?){
|
||||
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
|
||||
var options = plugins.lodash.assign(mergeOptions,optionsArg);
|
||||
console.log(plugins.figlet.textSync(textArg,{
|
||||
font: options.font,
|
||||
horizontalLayout: 'default',
|
||||
verticalLayout: 'default'
|
||||
})[options.color]);
|
||||
return true;
|
||||
};
|
@ -1,59 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
import plugins = require("./beautylog.plugins");
|
||||
|
||||
var localBl = {
|
||||
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
|
||||
errorPrefix: ' Error: '.bgRed.white.bold + ' ',
|
||||
infoPrefix: plugins.clc.bgXterm(198).xterm(231).bold(' INFO ') + ' ',
|
||||
normalPrefix: ' Log: '.bgCyan.white.bold + ' ',
|
||||
okPrefix: ' '.bgGreen + ' OK! '.bgBlack.green.bold + ' ',
|
||||
successPrefix: ' Success: '.bgGreen.white.bold + ' ',
|
||||
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param logText
|
||||
* @param logType
|
||||
* @returns {boolean}
|
||||
*/
|
||||
var logFunction = function(logText:string = 'empty log', logType:string = 'normal') {
|
||||
try {
|
||||
switch (logType) {
|
||||
case 'dir':
|
||||
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
|
||||
break;
|
||||
case 'error':
|
||||
logText = localBl.errorPrefix + logText.red.bold;
|
||||
break;
|
||||
case 'info':
|
||||
logText = localBl.infoPrefix + plugins.clc.xterm(198)(logText);
|
||||
break;
|
||||
case 'normal':
|
||||
logText = localBl.normalPrefix + logText.cyan.bold;
|
||||
break;
|
||||
case 'ok':
|
||||
logText = localBl.okPrefix + logText.bold;
|
||||
break;
|
||||
case 'success':
|
||||
logText = localBl.successPrefix + logText.green.bold;
|
||||
break;
|
||||
case 'warn':
|
||||
logText = localBl.warnPrefix + logText.bold;
|
||||
break;
|
||||
case 'log':
|
||||
default:
|
||||
logText.blue.bold;
|
||||
console.log(('unknown logType for "' + logText + '"').red.bold);
|
||||
break;
|
||||
}
|
||||
console.log(logText);
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
console.log(localBl.errorPrefix + 'You seem to have tried logging something strange'.red.bold + error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
export = logFunction;
|
@ -1,10 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import classes = require("./beautylog.classes");
|
||||
|
||||
var beautylogOsTable:any = {};
|
||||
|
||||
beautylogOsTable.new = function(typeArg:string,tableHeadArrayArg?) {
|
||||
var newConsoleTable = new classes.ConsoleTable(typeArg,tableHeadArrayArg);
|
||||
return newConsoleTable;
|
||||
};
|
||||
export = beautylogOsTable;
|
@ -1,63 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
export import log = require("./beautylog.node.log");
|
||||
export import table = require("./beautylog.node.table");
|
||||
export import code = require("./beautylog.node.code");
|
||||
import figletModule = require("./beautylog.node.figlet");
|
||||
|
||||
export let figlet = figletModule.figlet;
|
||||
export let figletSync = figletModule.figletSync;
|
||||
/**
|
||||
* logs an directory to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export let dir = function(logText) {
|
||||
return log(logText, 'dir');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* logs an error to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export let error = function(logText) {
|
||||
return log(logText, 'error');
|
||||
};
|
||||
|
||||
/**
|
||||
* logs an info to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export let info = function(logText) {
|
||||
return log(logText, 'info');
|
||||
};
|
||||
|
||||
/**
|
||||
* logs an 'OK!' message to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export let ok = function(logText) {
|
||||
return log(logText, 'ok');
|
||||
};
|
||||
|
||||
/**
|
||||
* logs a success to console
|
||||
* @param logText string to log as error
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export let success = function(logText) {
|
||||
return log(logText, 'success');
|
||||
};
|
||||
|
||||
/**
|
||||
* logs a 'warn:' message to console
|
||||
* @param logText string to log as error
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export let warn = function(logText) {
|
||||
return log(logText, 'warn');
|
||||
};
|
@ -1,17 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
var plugins:any = {
|
||||
lodash: require("lodash"),
|
||||
smartenv: require("smartenv"),
|
||||
q: require("q")
|
||||
};
|
||||
if (plugins.smartenv.getEnv().isNode){
|
||||
plugins = plugins.lodash.assign(plugins,{
|
||||
cliTable: require("cli-table2"),
|
||||
colors: require("colors"),
|
||||
clc: require("cli-color"),
|
||||
figlet: require("figlet"),
|
||||
hlight: require("hlight")
|
||||
});
|
||||
}
|
||||
export = plugins;
|
@ -1 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
135
ts/classes.destinationlocal.ts
Normal file
135
ts/classes.destinationlocal.ts
Normal file
@ -0,0 +1,135 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import type { ILogDestination, ILogPackage, TLogLevel } from '@push.rocks/smartlog-interfaces';
|
||||
|
||||
// other beautylog classes
|
||||
import { type TColorName } from '@push.rocks/consolecolor';
|
||||
|
||||
export class DestinationLocal implements ILogDestination {
|
||||
/**
|
||||
* handles a log according to the smartlog standard
|
||||
* @param logPackage
|
||||
*/
|
||||
public async handleLog(logPackage: ILogPackage) {
|
||||
this.logToConsole(logPackage);
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a new empty line
|
||||
* @param linesArg
|
||||
* @returns void
|
||||
*/
|
||||
public newLine(linesArg: number = 1) {
|
||||
for (let i = 0; i < linesArg; i++) {
|
||||
console.log('\n');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* logs a reduced log that only logs changes of consequential log messages
|
||||
*/
|
||||
public logReduced(logTextArg: string, repeatEveryTimesArg: number = 0) {
|
||||
if (
|
||||
logTextArg === this.previousMessage &&
|
||||
(repeatEveryTimesArg === 0 || this.sameMessageCounter !== repeatEveryTimesArg)
|
||||
) {
|
||||
this.sameMessageCounter++;
|
||||
} else {
|
||||
this.sameMessageCounter = 0;
|
||||
this.previousMessage = logTextArg;
|
||||
this.logToConsole({
|
||||
timestamp: Date.now(),
|
||||
type: 'log',
|
||||
level: 'info',
|
||||
context: {
|
||||
company: 'undefined',
|
||||
companyunit: 'undefined',
|
||||
containerName: 'undefined',
|
||||
environment: 'test',
|
||||
runtime: 'node',
|
||||
zone: 'undefined',
|
||||
},
|
||||
message: logTextArg,
|
||||
correlation: {
|
||||
id: 'none',
|
||||
type: 'none',
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
private previousMessage: string = '';
|
||||
private sameMessageCounter: number = 0;
|
||||
|
||||
// default logging
|
||||
private logToConsole(logPackageArg: ILogPackage) {
|
||||
let logString: string;
|
||||
try {
|
||||
logString =
|
||||
this.localBl[logPackageArg.level].prefix +
|
||||
plugins.consolecolor.coloredString(
|
||||
logPackageArg.message,
|
||||
this.localBl[logPackageArg.level].textColor
|
||||
);
|
||||
console.log(logString);
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log(
|
||||
this.localBl.errorPrefix + 'You seem to have tried logging something strange' + error
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private localBl: {
|
||||
[key: string]: {
|
||||
prefix: string;
|
||||
textColor: TColorName;
|
||||
};
|
||||
} = {
|
||||
silly: {
|
||||
prefix: plugins.consolecolor.coloredString(' silly ', 'white', 'blue') + ' ',
|
||||
textColor: 'blue',
|
||||
},
|
||||
error: {
|
||||
prefix:
|
||||
plugins.consolecolor.coloredString(' ', 'red', 'red') +
|
||||
plugins.consolecolor.coloredString(' ERROR! ', 'red', 'black') +
|
||||
' ',
|
||||
textColor: 'red',
|
||||
},
|
||||
info: {
|
||||
prefix:
|
||||
plugins.consolecolor.coloredString(' ', 'blue', 'blue') +
|
||||
plugins.consolecolor.coloredString(' info: ', 'blue', 'black') +
|
||||
' ',
|
||||
textColor: 'white',
|
||||
},
|
||||
note: {
|
||||
prefix:
|
||||
plugins.consolecolor.coloredString(' ', 'pink', 'pink') +
|
||||
plugins.consolecolor.coloredString(' note -> ', 'pink', 'black') +
|
||||
' ',
|
||||
textColor: 'pink',
|
||||
},
|
||||
ok: {
|
||||
prefix:
|
||||
plugins.consolecolor.coloredString(' ', 'green', 'green') +
|
||||
plugins.consolecolor.coloredString(' ok ', 'green', 'black') +
|
||||
' ',
|
||||
textColor: 'green',
|
||||
},
|
||||
success: {
|
||||
prefix:
|
||||
plugins.consolecolor.coloredString(' ', 'green', 'green') +
|
||||
plugins.consolecolor.coloredString(' SUCCESS! ', 'green', 'black') +
|
||||
' ',
|
||||
textColor: 'green',
|
||||
},
|
||||
warn: {
|
||||
prefix:
|
||||
plugins.consolecolor.coloredString(' ', 'orange', 'orange') +
|
||||
plugins.consolecolor.coloredString(' WARN -> ', 'orange', 'black') +
|
||||
' ',
|
||||
textColor: 'orange',
|
||||
},
|
||||
};
|
||||
}
|
21
ts/index.ts
21
ts/index.ts
@ -1,19 +1,2 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
import plugins = require("./beautylog.plugins");
|
||||
import BeautylogNode = require("./beautylog.node");
|
||||
import BeautylogBrowser = require("./beautylog.browser");
|
||||
var beautylog;
|
||||
switch(plugins.smartenv.getEnv().runtimeEnv) {
|
||||
case "node":
|
||||
beautylog = BeautylogNode;
|
||||
break;
|
||||
case "browser":
|
||||
beautylog = BeautylogBrowser;
|
||||
break;
|
||||
default:
|
||||
console.log("something is strange about the platform in which you try to use beautylog");
|
||||
break;
|
||||
}
|
||||
|
||||
export = beautylog;
|
||||
// export classes
|
||||
export { DestinationLocal } from './classes.destinationlocal.js';
|
||||
|
5
ts/plugins.ts
Normal file
5
ts/plugins.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as consolecolor from '@push.rocks/consolecolor';
|
||||
import * as smartlogInterfaces from '@push.rocks/smartlog-interfaces';
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
|
||||
export { consolecolor, smartlogInterfaces, smartpromise };
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"ambientDependencies": {
|
||||
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
|
||||
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
|
||||
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts"
|
||||
}
|
||||
}
|
3
ts/typings/browser.d.ts
vendored
3
ts/typings/browser.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
/// <reference path="browser/ambient/colors/colors.d.ts" />
|
||||
/// <reference path="browser/ambient/mocha/mocha.d.ts" />
|
||||
/// <reference path="browser/ambient/node/node.d.ts" />
|
125
ts/typings/browser/ambient/colors/colors.d.ts
vendored
125
ts/typings/browser/ambient/colors/colors.d.ts
vendored
@ -1,125 +0,0 @@
|
||||
// Compiled using typings@0.6.8
|
||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/colors/colors.d.ts
|
||||
// Type definitions for Colors.js 0.6.0-1
|
||||
// Project: https://github.com/Marak/colors.js
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "colors" {
|
||||
interface Color {
|
||||
(text: string): string;
|
||||
|
||||
black: Color;
|
||||
red: Color;
|
||||
green: Color;
|
||||
yellow: Color;
|
||||
blue: Color;
|
||||
magenta: Color;
|
||||
cyan: Color;
|
||||
white: Color;
|
||||
gray: Color;
|
||||
grey: Color;
|
||||
|
||||
bgBlack: Color;
|
||||
bgRed: Color;
|
||||
bgGreen: Color;
|
||||
bgYellow: Color;
|
||||
bgBlue: Color;
|
||||
bgMagenta: Color;
|
||||
bgCyan: Color;
|
||||
bgWhite: Color;
|
||||
|
||||
reset: Color;
|
||||
bold: Color;
|
||||
dim: Color;
|
||||
italic: Color;
|
||||
underline: Color;
|
||||
inverse: Color;
|
||||
hidden: Color;
|
||||
strikethrough: Color;
|
||||
|
||||
rainbow: Color;
|
||||
zebra: Color;
|
||||
america: Color;
|
||||
trap: Color;
|
||||
random: Color;
|
||||
}
|
||||
|
||||
module e {
|
||||
export function setTheme(theme:any): void;
|
||||
|
||||
export var black: Color;
|
||||
export var red: Color;
|
||||
export var green: Color;
|
||||
export var yellow: Color;
|
||||
export var blue: Color;
|
||||
export var magenta: Color;
|
||||
export var cyan: Color;
|
||||
export var white: Color;
|
||||
export var gray: Color;
|
||||
export var grey: Color;
|
||||
|
||||
export var bgBlack: Color;
|
||||
export var bgRed: Color;
|
||||
export var bgGreen: Color;
|
||||
export var bgYellow: Color;
|
||||
export var bgBlue: Color;
|
||||
export var bgMagenta: Color;
|
||||
export var bgCyan: Color;
|
||||
export var bgWhite: Color;
|
||||
|
||||
export var reset: Color;
|
||||
export var bold: Color;
|
||||
export var dim: Color;
|
||||
export var italic: Color;
|
||||
export var underline: Color;
|
||||
export var inverse: Color;
|
||||
export var hidden: Color;
|
||||
export var strikethrough: Color;
|
||||
|
||||
export var rainbow: Color;
|
||||
export var zebra: Color;
|
||||
export var america: Color;
|
||||
export var trap: Color;
|
||||
export var random: Color;
|
||||
}
|
||||
|
||||
export = e;
|
||||
}
|
||||
|
||||
interface String {
|
||||
black: string;
|
||||
red: string;
|
||||
green: string;
|
||||
yellow: string;
|
||||
blue: string;
|
||||
magenta: string;
|
||||
cyan: string;
|
||||
white: string;
|
||||
gray: string;
|
||||
grey: string;
|
||||
|
||||
bgBlack: string;
|
||||
bgRed: string;
|
||||
bgGreen: string;
|
||||
bgYellow: string;
|
||||
bgBlue: string;
|
||||
bgMagenta: string;
|
||||
bgCyan: string;
|
||||
bgWhite: string;
|
||||
|
||||
reset: string;
|
||||
bold: string;
|
||||
dim: string;
|
||||
italic: string;
|
||||
underline: string;
|
||||
inverse: string;
|
||||
hidden: string;
|
||||
strikethrough: string;
|
||||
|
||||
rainbow: string;
|
||||
zebra: string;
|
||||
america: string;
|
||||
trap: string;
|
||||
random: string;
|
||||
}
|
40
ts/typings/browser/ambient/mocha/mocha.d.ts
vendored
40
ts/typings/browser/ambient/mocha/mocha.d.ts
vendored
@ -1,40 +0,0 @@
|
||||
// Compiled using typings@0.6.8
|
||||
// Source: https://raw.githubusercontent.com/Bartvds/tsd-deftools/master/typings/DefinitelyTyped/mocha/mocha.d.ts
|
||||
// Type definitions for mocha 1.9.0
|
||||
// Project: http://visionmedia.github.io/mocha/
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var describe : {
|
||||
(description: string, spec: () => void): void;
|
||||
only(description: string, spec: () => void): void;
|
||||
skip(description: string, spec: () => void): void;
|
||||
timeout(ms: number);
|
||||
}
|
||||
|
||||
declare var it: {
|
||||
(expectation: string, assertion?: () => void): void;
|
||||
(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
only(expectation: string, assertion?: () => void): void;
|
||||
only(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
skip(expectation: string, assertion?: () => void): void;
|
||||
skip(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
timeout(ms: number);
|
||||
};
|
||||
|
||||
declare function before(action: () => void): void;
|
||||
|
||||
declare function before(action: (done: () => void) => void): void;
|
||||
|
||||
declare function aftet(action: () => void): void;
|
||||
|
||||
declare function after(action: (done: () => void) => void): void;
|
||||
|
||||
declare function beforeEach(action: () => void): void;
|
||||
|
||||
declare function beforeEach(action: (done: () => void) => void): void;
|
||||
|
||||
declare function afterEach(action: () => void): void;
|
||||
|
||||
declare function afterEach(action: (done: () => void) => void): void;
|
2196
ts/typings/browser/ambient/node/node.d.ts
vendored
2196
ts/typings/browser/ambient/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
3
ts/typings/main.d.ts
vendored
3
ts/typings/main.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
/// <reference path="main/ambient/colors/colors.d.ts" />
|
||||
/// <reference path="main/ambient/mocha/mocha.d.ts" />
|
||||
/// <reference path="main/ambient/node/node.d.ts" />
|
125
ts/typings/main/ambient/colors/colors.d.ts
vendored
125
ts/typings/main/ambient/colors/colors.d.ts
vendored
@ -1,125 +0,0 @@
|
||||
// Compiled using typings@0.6.8
|
||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/colors/colors.d.ts
|
||||
// Type definitions for Colors.js 0.6.0-1
|
||||
// Project: https://github.com/Marak/colors.js
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "colors" {
|
||||
interface Color {
|
||||
(text: string): string;
|
||||
|
||||
black: Color;
|
||||
red: Color;
|
||||
green: Color;
|
||||
yellow: Color;
|
||||
blue: Color;
|
||||
magenta: Color;
|
||||
cyan: Color;
|
||||
white: Color;
|
||||
gray: Color;
|
||||
grey: Color;
|
||||
|
||||
bgBlack: Color;
|
||||
bgRed: Color;
|
||||
bgGreen: Color;
|
||||
bgYellow: Color;
|
||||
bgBlue: Color;
|
||||
bgMagenta: Color;
|
||||
bgCyan: Color;
|
||||
bgWhite: Color;
|
||||
|
||||
reset: Color;
|
||||
bold: Color;
|
||||
dim: Color;
|
||||
italic: Color;
|
||||
underline: Color;
|
||||
inverse: Color;
|
||||
hidden: Color;
|
||||
strikethrough: Color;
|
||||
|
||||
rainbow: Color;
|
||||
zebra: Color;
|
||||
america: Color;
|
||||
trap: Color;
|
||||
random: Color;
|
||||
}
|
||||
|
||||
module e {
|
||||
export function setTheme(theme:any): void;
|
||||
|
||||
export var black: Color;
|
||||
export var red: Color;
|
||||
export var green: Color;
|
||||
export var yellow: Color;
|
||||
export var blue: Color;
|
||||
export var magenta: Color;
|
||||
export var cyan: Color;
|
||||
export var white: Color;
|
||||
export var gray: Color;
|
||||
export var grey: Color;
|
||||
|
||||
export var bgBlack: Color;
|
||||
export var bgRed: Color;
|
||||
export var bgGreen: Color;
|
||||
export var bgYellow: Color;
|
||||
export var bgBlue: Color;
|
||||
export var bgMagenta: Color;
|
||||
export var bgCyan: Color;
|
||||
export var bgWhite: Color;
|
||||
|
||||
export var reset: Color;
|
||||
export var bold: Color;
|
||||
export var dim: Color;
|
||||
export var italic: Color;
|
||||
export var underline: Color;
|
||||
export var inverse: Color;
|
||||
export var hidden: Color;
|
||||
export var strikethrough: Color;
|
||||
|
||||
export var rainbow: Color;
|
||||
export var zebra: Color;
|
||||
export var america: Color;
|
||||
export var trap: Color;
|
||||
export var random: Color;
|
||||
}
|
||||
|
||||
export = e;
|
||||
}
|
||||
|
||||
interface String {
|
||||
black: string;
|
||||
red: string;
|
||||
green: string;
|
||||
yellow: string;
|
||||
blue: string;
|
||||
magenta: string;
|
||||
cyan: string;
|
||||
white: string;
|
||||
gray: string;
|
||||
grey: string;
|
||||
|
||||
bgBlack: string;
|
||||
bgRed: string;
|
||||
bgGreen: string;
|
||||
bgYellow: string;
|
||||
bgBlue: string;
|
||||
bgMagenta: string;
|
||||
bgCyan: string;
|
||||
bgWhite: string;
|
||||
|
||||
reset: string;
|
||||
bold: string;
|
||||
dim: string;
|
||||
italic: string;
|
||||
underline: string;
|
||||
inverse: string;
|
||||
hidden: string;
|
||||
strikethrough: string;
|
||||
|
||||
rainbow: string;
|
||||
zebra: string;
|
||||
america: string;
|
||||
trap: string;
|
||||
random: string;
|
||||
}
|
40
ts/typings/main/ambient/mocha/mocha.d.ts
vendored
40
ts/typings/main/ambient/mocha/mocha.d.ts
vendored
@ -1,40 +0,0 @@
|
||||
// Compiled using typings@0.6.8
|
||||
// Source: https://raw.githubusercontent.com/Bartvds/tsd-deftools/master/typings/DefinitelyTyped/mocha/mocha.d.ts
|
||||
// Type definitions for mocha 1.9.0
|
||||
// Project: http://visionmedia.github.io/mocha/
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var describe : {
|
||||
(description: string, spec: () => void): void;
|
||||
only(description: string, spec: () => void): void;
|
||||
skip(description: string, spec: () => void): void;
|
||||
timeout(ms: number);
|
||||
}
|
||||
|
||||
declare var it: {
|
||||
(expectation: string, assertion?: () => void): void;
|
||||
(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
only(expectation: string, assertion?: () => void): void;
|
||||
only(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
skip(expectation: string, assertion?: () => void): void;
|
||||
skip(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
timeout(ms: number);
|
||||
};
|
||||
|
||||
declare function before(action: () => void): void;
|
||||
|
||||
declare function before(action: (done: () => void) => void): void;
|
||||
|
||||
declare function aftet(action: () => void): void;
|
||||
|
||||
declare function after(action: (done: () => void) => void): void;
|
||||
|
||||
declare function beforeEach(action: () => void): void;
|
||||
|
||||
declare function beforeEach(action: (done: () => void) => void): void;
|
||||
|
||||
declare function afterEach(action: () => void): void;
|
||||
|
||||
declare function afterEach(action: (done: () => void) => void): void;
|
2196
ts/typings/main/ambient/node/node.d.ts
vendored
2196
ts/typings/main/ambient/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user