Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
The yosay npm package is a fun utility that allows you to display messages in a speech bubble format, similar to the classic 'cowsay' but with a character resembling Yeoman. It's often used to add a bit of humor or personality to command-line interfaces.
Basic Message Display
This feature allows you to display a basic message in a speech bubble format. The code sample shows how to require the yosay package and use it to print 'Hello, world!' in a speech bubble.
const yosay = require('yosay');
console.log(yosay('Hello, world!'));
Multiline Message Display
This feature allows you to display multiline messages. The code sample demonstrates how to print a message that spans multiple lines in a speech bubble.
const yosay = require('yosay');
console.log(yosay('Hello, world!
This is a multiline message.'));
Customizing the Character
This feature allows you to customize the speech bubble, such as setting a maximum length for the message. The code sample shows how to limit the message length to 20 characters.
const yosay = require('yosay');
console.log(yosay('Hello, world!', { maxLength: 20 }));
The cowsay package is a popular alternative that displays messages in a speech bubble with an ASCII art cow. It offers various customization options, including different characters and speech bubble styles. Compared to yosay, cowsay has a wider range of characters and is more widely known.
The figlet package allows you to create text banners in various ASCII art fonts. While it doesn't provide speech bubbles, it is often used to add stylized text to command-line interfaces. Figlet focuses more on text art rather than character-based speech bubbles like yosay.
The cli-boxes package provides box-drawing characters for creating boxes in the terminal. It doesn't offer speech bubbles or characters, but it can be used to create custom box designs around text. This package is more about creating structured layouts rather than adding personality to messages.
Tell Yeoman what to say
Like cowsay, but less cow.
$ npm install --save yosay
const yosay = require('yosay');
console.log(yosay('Hello, and welcome to my fantastic generator full of whimsy and bubble gum!'));
/*
_-----_ ╭──────────────────────────╮
| | │ Hello, and welcome to my │
|--(o)--| │ fantastic generator full │
`---------´ │ of whimsy and bubble │
( _´U`_ ) │ gum! │
/___A___\ /╰──────────────────────────╯
| ~ |
__'.___.'__
´ ` |° ´ Y `
*/
You can style your text with chalk before passing it to yosay
.
$ npm install --global yosay
$ yosay --help
Usage
yosay <string>
yosay <string> --maxLength 8
echo <string> | yosay
Example
yosay 'Sindre is a horse'
_-----_
| |
|--(o)--| ╭──────────────────────────╮
`---------´ │ Sindre is a horse │
( _´U`_ ) ╰──────────────────────────╯
/___A___\ /
| ~ |
__'.___.'__
´ ` |° ´ Y `
BSD license Copyright (c) Google
FAQs
Tell Yeoman what to say
The npm package yosay receives a total of 164,771 weekly downloads. As such, yosay popularity was classified as popular.
We found that yosay demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.