Compare commits
280 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 | |||
a28f3ecc1d | |||
75524afafb | |||
3745ac97b5 | |||
ebc1fd65f1 | |||
f80cba0037 | |||
6bc072d4a3 | |||
43799144a4 | |||
075c71ebe4 | |||
9d5ed74e6c | |||
249287fc9d | |||
387f7bb608 | |||
1577333a76 | |||
b75fcde83b | |||
6a9aaebcf6 | |||
499d7604fb | |||
24422f2a7e | |||
d0064fadd9 | |||
70ca8fa3e9 | |||
7ae750c70e | |||
cdbc6a4e7f | |||
1691b89fcf | |||
aa4f3d980a | |||
5c52e6f9ed | |||
5f6c94c167 | |||
f1e50a0c08 | |||
155ba55674 | |||
165d6c515d | |||
ed1b6a9a65 | |||
88e91bfc29 | |||
9a6c88c544 | |||
423f634622 | |||
f7bb7184ac | |||
22c486a16b | |||
6340dea34a | |||
ea06f32ce0 | |||
1f9a2257fc | |||
bebb694591 | |||
f61bc4cfe5 | |||
1ffe180376 | |||
|
14bae9cbfd | ||
|
17313ea79a | ||
|
cce4cd3472 | ||
|
c256c4b840 | ||
|
6163e9f57d | ||
|
2adf0e2bd3 | ||
|
6ae05de2b1 | ||
|
9c72b86d29 | ||
|
bbe7ac0a28 | ||
|
d79714a2e1 | ||
|
4f0185a1aa | ||
|
0aafb76046 | ||
|
5b8fce66fe | ||
|
5f26196ef5 | ||
|
63c020b84e | ||
|
ea5c96ec49 | ||
|
60d6cddea7 | ||
|
7a5d1469ba | ||
|
be71cdb472 | ||
|
fd5f02d6c7 | ||
|
3e048da0df | ||
|
d04f5ece8e | ||
|
915b3d5f5e | ||
|
8e74e71911 | ||
|
8035a6b17d | ||
|
9a36c8e08c | ||
|
52a315c0e0 | ||
|
b4e4113550 | ||
|
44415e602b | ||
|
602f68f93a | ||
|
4dbc481ef8 | ||
|
b92f92dfbd | ||
|
f79c2c329f | ||
|
0d3dc7e606 | ||
|
de45e44c0d | ||
|
b9247614cb | ||
|
23887bc129 | ||
|
a7ae3ad84c | ||
|
a69e5fc653 | ||
|
e03afcb843 | ||
|
219bcc2e99 | ||
|
959fd9004a |
22
.gitignore
vendored
22
.gitignore
vendored
@ -1,2 +1,20 @@
|
||||
.idea/
|
||||
node_modules
|
||||
.nogit/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
pages/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
# 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
|
11
.npmignore
Normal file
11
.npmignore
Normal file
@ -0,0 +1,11 @@
|
||||
node_modules/
|
||||
coverage/
|
||||
pages/
|
||||
public/
|
||||
|
||||
ts/
|
||||
docs/
|
||||
|
||||
|
||||
|
||||
.nogit/
|
19
.travis.yml
19
.travis.yml
@ -1,19 +0,0 @@
|
||||
language: node_js
|
||||
before_install:
|
||||
- nvm install stable
|
||||
- node -v
|
||||
- npm -v
|
||||
- npm install -g gulp
|
||||
- npm install gulp
|
||||
- npm install gulp-typescript
|
||||
deploy:
|
||||
provider: npm
|
||||
email: npm@smart-coordination.com
|
||||
api_key:
|
||||
secure: S47eRu6ZdNqKq+g3/fHHqODr+9agOk+rqaJ7i25Es8lZCFsAP4KpHbqLuKKC/mhCxKZ/ToWWWO8N03DkeOIgolpOzl1phfYECzI/Pkt7g0LLn1RIt+d+4U8XgBdqVkEsWHidKXj31Tgzp0Km1z2pNsJburI72hcdoHryXayGUNbpw8gHAUKiBha7wRz8dqC1msNWCkBxkwPcYZdVlnAIuAhX5OeFKpn0NNKJn8Ip9XizGfo/gulYdRxt2KtOpM22rAvD9RdU5PhWKPlb2+oVYV/K3IZx3KYE8lnLSrrQm9dCLuUCGKNs010HfFX5x9zwZNALzMhzW+KduHIXrghXBuVbTYxbDAE2QC/XoBcrza5p2E8mZyAGsFnWDCQhDHPiQB0rBJQqwITsKcvu73H5axxcD8KsxVX5hUStUEPSLz9tDLdA85/1nXuvzm6X6k2HD4f9jqA8KmOCiWBGkDe4CSMC1Qigt2E6thm1i82rMIkD67AvBP/NsU6xQaZHYm0Ol5Wc0oakYRvLaLZ+6+VaZiFt9tXz4wxTUkHbYI8OwXq5e1sASkWZcpAVCYK4amGBno+Q2M4qRMiofd4ewlF5G3eyzWF1q5YadArds92nGvWdj+tuymfo6zC2hWSKVN3pkshT8bcUyLRsqwQCDXJ5CDVvXiVQE18FpVEbUCyixig=
|
||||
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"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
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)
|
62
index.js
62
index.js
@ -1,62 +0,0 @@
|
||||
/// <reference path="./typings/tsd.d.ts" />
|
||||
var colors = require("colors");
|
||||
var through = require("through2");
|
||||
var bl;
|
||||
bl = {};
|
||||
/**
|
||||
* object to append to all locally used params
|
||||
* @type {{}}
|
||||
*/
|
||||
var localBl;
|
||||
localBl = {};
|
||||
localBl.errorPrefix = ' Error: '.bgRed.white.bold;
|
||||
localBl.successPrefix = ' Success: '.bgGreen.white.bold;
|
||||
/**
|
||||
*
|
||||
* @param logText
|
||||
* @param logType
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bl.log = function (logText, logType) {
|
||||
if (logText === void 0) { logText = 'empty log'; }
|
||||
if (logType === void 0) { logType = 'normal'; }
|
||||
try {
|
||||
switch (logType) {
|
||||
case 'normal':
|
||||
logText.cyan.bold;
|
||||
break;
|
||||
case 'error':
|
||||
logText = localBl.errorPrefix + logText.red.bold;
|
||||
break;
|
||||
case 'success':
|
||||
logText = localBl.successPrefix + logText.cyan.bold;
|
||||
break;
|
||||
default:
|
||||
logText.blue.bold;
|
||||
console.log(('unknown logType for "' + logText + '"').red.bold);
|
||||
}
|
||||
console.log(logText);
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
console.log(localBl.errorPrefix + 'You seem to have tried logging something strange'.red.bold + error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* logs an error to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bl.error = function (logText) {
|
||||
return bl.log(logText, 'error');
|
||||
};
|
||||
/**
|
||||
* logs a success to console
|
||||
* @param logText string to log as error
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bl.success = function (logText) {
|
||||
return bl.log(logText, 'success');
|
||||
};
|
||||
module.exports = bl;
|
@ -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"
|
||||
}
|
||||
}
|
63
package.json
63
package.json
@ -1,28 +1,59 @@
|
||||
{
|
||||
"name": "beautylog",
|
||||
"version": "0.0.8",
|
||||
"description": "beautiful logging",
|
||||
"main": "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": "cd ts/compile && gulp"
|
||||
"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": {
|
||||
"beautylog": "latest"
|
||||
}
|
||||
}
|
||||
"@push.rocks/consolecolor": "^2.0.1",
|
||||
"@push.rocks/smartlog-interfaces": "^3.0.0",
|
||||
"@push.rocks/smartpromise": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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.
|
49
test/test.ts
Normal file
49
test/test.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
|
||||
import * as smartlogDesinationLocal from '../ts/index.js';
|
||||
import type { ILogContext } from '@push.rocks/smartlog-interfaces';
|
||||
|
||||
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();
|
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'
|
||||
}
|
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',
|
||||
},
|
||||
};
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
nvm use v0.12.7
|
||||
gulp
|
@ -1,16 +0,0 @@
|
||||
// import gulp
|
||||
var gulp = require("gulp"),
|
||||
gulpTypescript = require("gulp-typescript");
|
||||
|
||||
gulp.task('compileTS', function() {
|
||||
var stream = gulp.src('../index.ts')
|
||||
.pipe(gulpTypescript({
|
||||
out: "index.js"
|
||||
}))
|
||||
.pipe(gulp.dest("../../"));
|
||||
return stream;
|
||||
});
|
||||
|
||||
gulp.task('default',['compileTS'], function() {
|
||||
console.log('Typescript compiled');
|
||||
});
|
@ -1,2 +0,0 @@
|
||||
# How to compile.
|
||||
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.
|
70
ts/index.ts
70
ts/index.ts
@ -1,68 +1,2 @@
|
||||
/// <reference path="./typings/tsd.d.ts" />
|
||||
var colors = require("colors");
|
||||
var through = require("through2");
|
||||
|
||||
|
||||
var bl:any;
|
||||
bl = {}
|
||||
|
||||
/**
|
||||
* object to append to all locally used params
|
||||
* @type {{}}
|
||||
*/
|
||||
var localBl:any;
|
||||
localBl = {};
|
||||
localBl.errorPrefix = ' Error: '.bgRed.white.bold;
|
||||
localBl.successPrefix = ' Success: '.bgGreen.white.bold;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param logText
|
||||
* @param logType
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bl.log = (logText:string = 'empty log',logType:string = 'normal') => {
|
||||
try {
|
||||
switch (logType) {
|
||||
case 'normal':
|
||||
logText.cyan.bold;
|
||||
break;
|
||||
case 'error':
|
||||
logText = localBl.errorPrefix + logText.red.bold;
|
||||
break;
|
||||
case 'success':
|
||||
logText = localBl.successPrefix + logText.cyan.bold;
|
||||
break;
|
||||
default:
|
||||
logText.blue.bold;
|
||||
console.log(('unknown logType for "' + logText + '"').red.bold);
|
||||
}
|
||||
console.log(logText);
|
||||
return true;
|
||||
}
|
||||
catch(error) {
|
||||
console.log(localBl.errorPrefix + 'You seem to have tried logging something strange'.red.bold + error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* logs an error to console
|
||||
* @param logText
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bl.error = function(logText) {
|
||||
return bl.log(logText, 'error');
|
||||
};
|
||||
|
||||
/**
|
||||
* logs a success to console
|
||||
* @param logText string to log as error
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bl.success = function(logText) {
|
||||
return bl.log(logText, 'success');
|
||||
}
|
||||
|
||||
module.exports = bl;
|
||||
// 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 };
|
15
ts/tsd.json
15
ts/tsd.json
@ -1,15 +0,0 @@
|
||||
{
|
||||
"version": "v4",
|
||||
"repo": "borisyankov/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"node/node.d.ts": {
|
||||
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
|
||||
},
|
||||
"colors/colors.d.ts": {
|
||||
"commit": "273a567b0a0bcc34cbf2a2470b2febc95796b644"
|
||||
}
|
||||
}
|
||||
}
|
123
ts/typings/colors/colors.d.ts
vendored
123
ts/typings/colors/colors.d.ts
vendored
@ -1,123 +0,0 @@
|
||||
// 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;
|
||||
}
|
2079
ts/typings/node/node.d.ts
vendored
2079
ts/typings/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2
ts/typings/tsd.d.ts
vendored
2
ts/typings/tsd.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
/// <reference path="node/node.d.ts" />
|
||||
/// <reference path="colors/colors.d.ts" />
|
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