Comparing version 1.0.0 to 1.1.0
@@ -1,1 +0,1 @@ | ||
{"version":2,"languages":{"nodejs-npm":{"specfileHash":"efca438c0e466fea357010de22933b61","lockfileHash":"9b9a3f42f8af387fffd5837dbe585cd7","guessedImports":["node-fetch"],"guessedImportsHash":"7b863fa74f88a2d7c81fca98c08d9058"}}} | ||
{"version":2,"languages":{"nodejs-npm":{"specfileHash":"4802b1bfdcf3572ae4c4cde96531c011","lockfileHash":"9b9a3f42f8af387fffd5837dbe585cd7","guessedImports":["node-fetch"],"guessedImportsHash":"7b863fa74f88a2d7c81fca98c08d9058"}}} |
{ | ||
"name": "stump.js", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Innovative logging for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -21,2 +21,7 @@ # Stump.js | ||
To enable timestamps, add the `Timestamp` feature. | ||
Output: | ||
![Output example](https://cdn.discordapp.com/attachments/898047385211637790/898055553383825478/unknown.png) | ||
### Logging methods: | ||
@@ -23,0 +28,0 @@ |
@@ -37,8 +37,11 @@ /* | ||
console: async (type, settings, ...messages) => { | ||
if (type === 'info') console.log('\x1b[47m\x1b[30m INFO \x1b[0m', ...messages); | ||
if (type === 'success') console.log('\x1b[42m\x1b[30m SUCCESS \x1b[0m', ...messages); | ||
if (type === 'verbose') console.log('\x1b[44m\x1b[30m VERBOSE \x1b[0m', ...messages); | ||
if (type === 'error') console.error('\x1b[41m\x1b[30m ERROR \x1b[0m', ...messages); | ||
if (type === 'warn') console.warn('\x1b[43m\x1b[30m WARN \x1b[0m', ...messages); | ||
if (type === 'debug') console.log('\x1b[45m\x1b[30m DEBUG \x1b[0m', ...messages); | ||
let timestamp = new Date().toUTCString(); | ||
timestamp = ' \x1b[2m' + timestamp + '\x1b[0m |'; | ||
if (!settings.timestamp) timestamp = ''; | ||
if (type === 'info') console.log('\x1b[47m\x1b[30m INFO \x1b[0m' + timestamp, ...messages); | ||
if (type === 'success') console.log('\x1b[42m\x1b[30m SUCCESS \x1b[0m' + timestamp, ...messages); | ||
if (type === 'verbose') console.log('\x1b[44m\x1b[30m VERBOSE \x1b[0m' + timestamp, ...messages); | ||
if (type === 'error') console.error('\x1b[41m\x1b[30m ERROR \x1b[0m' + timestamp, ...messages); | ||
if (type === 'warn') console.warn('\x1b[43m\x1b[30m WARN \x1b[0m' + timestamp, ...messages); | ||
if (type === 'debug') console.log('\x1b[45m\x1b[30m DEBUG \x1b[0m' + timestamp, ...messages); | ||
return 0; | ||
@@ -80,2 +83,5 @@ }, | ||
} | ||
if (typeof feature === 'string' && feature.toLowerCase() === 'timestamp') { | ||
this.settings.timestamp = true; | ||
} | ||
} | ||
@@ -82,0 +88,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6815
130
33