Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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 yosay
import yosay from '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 `
FAQs
Tell Yeoman what to say
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.