
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Stylog is a stylish way how to easily format rich console.log messages.
It's overengineered on purpose I just wanted to write it in the "old school" way and avoid RegExps. It has been written with a nostalgic memory to the Dragon Book 🐲
yarn add stylog
The library is targeted for the last two version of Chrome, it's designed to be used mostly in dev mode within latest dev tools.
stylog(
(recipe: string),
(stylesDictionary: ?{
[id: string]: {
[property: string]: string
}
}),
(mapperDictionary ?{
[id: string]: (value: string) => string
})
);
If you are fan of FP you can take full advantage of the data-last curried version!✌️
stylog.fp(mapperDictionary)(stylesDictionary)(recipe);
This is normal text {styled this is styled text}
This is normal text \{styled this is also normal text}
{
styled: {
fontSize: "20px"; // or "fontSize: 20" :)
}
}
{
// return c👏l👏a👏p👏e👏d string
clap: s => {
return [...s]
.map((a, i) => `${a}${i !== s.length - 1 ? "👏" : ""}`)
.join("");
};
}
Check it out the example/index.html for interactive playground! 🙌
stylog(
`{big Hello, everyone! This is nicely styled text!}
and non-styled text. Lovely, right? {bold *clap* *clap* *clap*}
{image [GANDALF]} {red Be aware! Wild Gandalf appears!}
.
.
.
\\{gandalf}
.
.
.
not like this
.
.
.
{gandalf}
{clap Awesome}`,
{
bold: {
fontWeight: "bold"
},
big: {
fontSize: "25px",
border: "1px solid black",
padding: "10px"
},
image: {
display: "block !important",
color: "gray",
fontSize: "10px",
background: `url("https://vignette.wikia.nocookie.net/casshan/images/d/dc/Warn.png/revision/latest?cb=20120614181856")`,
backgroundSize: "15px 15px",
backgroundRepeat: "no-repeat",
backgroundPosition: "left",
paddingLeft: "15px"
},
red: {
color: "red",
textDecoration: "underline"
},
gandalf: {
display: "block !important",
color: "gray",
fontSize: "300px",
lineHeight: "150px",
display: "block !important",
background: `url("https://i.giphy.com/media/FyetIxXamPsfC/giphy.webp")`,
backgroundSize: "200px",
backgroundRepeat: "no-repeat",
backgroundPosition: "left"
},
clap: {
background: "black",
color: "yellow"
}
},
{
clap: s => {
return [...s]
.map((a, i) => `${a}${i !== s.length - 1 ? "👏" : ""}`)
.join("");
}
}
);
will produce this:
Do you miss something? Open an issue, I'd like to hear more about your use case. You can also fork this repository and run yarn && yarn dev, do stuff in the playground (example/index.html), then run yarn test and finally send a PR! ❤️
The MIT License (MIT) 2018 - Jakub Beneš
FAQs
🎨 Stylish way how to easily format console.log messages
We found that stylog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.