Gathering detailed insights and metrics for process.logger
Gathering detailed insights and metrics for process.logger
Gathering detailed insights and metrics for process.logger
Gathering detailed insights and metrics for process.logger
npm install process.logger
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
11 Commits
1 Forks
2 Watchers
1 Branches
1 Contributors
Updated on Nov 28, 2016
Latest Version
1.1.3
Package Id
process.logger@1.1.3
Size
4.02 kB
NPM Version
3.10.8
Node Version
6.9.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
A simple tool to log message in node console.
github: https://github.com/tangshuang/process.logger
npm install process.logger
Notice: these words begin with "bg"
1 string arguments
logger(msg[, msg, ...])
Just like console.log
, For example:
var logger = require("process.logger")
logger("This is a message.")
logger("Another message.")
2 object arguments
logger(object[, object, ...])
You can set attibutions of text, color, style, background
, not required:
object: {
text: "",
color: "",
style: "",
background: "",
}
For example:
var logger = require("process.logger");
logger({
text: "This half is red.",
color: "red",
}, {
text: "This half is green.",
background: "green",
});
It will print only one sentence, but different color/background.
.set(key, value)
Use set
to set global style of this sentence. e.g.
logger.set("color", "red").set("style", "bold").set("background", "white")
If you set "color" twice, the last one will be used.
timestamp
key is special:
logger.set("timestamp", {
color: "red"
}).log("This is a sentence beginning with tiemstamp!")
You should try in preview/index.html
to view different cases.
Sometimes you want to know current settings, you can call .get()
, e.g.
var color = Logger.get("color")
.put(msg[, options])
Add words into sentence. e.g.
logger.set(...).put("This is a").put("PIG", {
color: "red",
style: "bold",
}).print()
The options will cover settings of set
.
.print()
After you set and put, you should call print to print sentence in console.
logger.set(...).put(...).print()
.log(msg[, options])
With .print()
, you can not pass parameters, but with .log()
, you can. In fact, .log()
do a put(msg).print()
action.
logger.set(...).log("Go away!")
Remember that, you must call .print()
or .log()
after .put()
, or nothing will print.
.reset()
After you set
and put
, content was set in cache. If you do not, reset, youwill found it works in next print.
logger.set(...)
// do something else
logger.put(...)
// do something else
logger.log(msg)
You can see the settings and put content is in the result.
So if you are not sure whether the cache is clean, just reset it before you set and put.
Howerever, print
and log
automaticly do reset
.
To provide a quick way to log special colors messages, some alias name api are provided:
logger.ok("This message is green!")
logger.warn("this message is red")
logger.set("color", "green").warn("It is red permanently!")
logger.set("style", "bold").debug("It is bold.")
logger.debug("It is bold.", {
"style": "bold"
})
logger.set("timestamp", true).success("Message is green, but timestamp is not.")
However, you do not need to reset
cache after you call this alias apis, because they call log
inside. And every time you call log, print, done, warn...
, reset
is called at the end, so you have to set, put
again if you want to.
This package is written by ES6, run
npm run babel
to build source code.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More