Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
62a9b0e475 | |||
eb631ae97e | |||
7ea4324ff8 | |||
4442ef368c | |||
947bd03223 | |||
95e6295feb | |||
e294710a0f | |||
81228d1972 |
25
changelog.md
25
changelog.md
@ -1,5 +1,30 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-01-14 - 1.0.10 - fix(test)
|
||||||
|
Add logging for rendered text outputs in test cases
|
||||||
|
|
||||||
|
- Added console.log statements for outputs of rendered ASCII art in test cases.
|
||||||
|
- Ensure the correctness of rendering operations by outputting results during tests.
|
||||||
|
|
||||||
|
## 2025-01-14 - 1.0.9 - fix(npm)
|
||||||
|
Updated package description and added more keywords for better visibility
|
||||||
|
|
||||||
|
|
||||||
|
## 2025-01-14 - 1.0.8 - fix(documentation)
|
||||||
|
Update README to reflect recent changes
|
||||||
|
|
||||||
|
- Updated package description for accuracy.
|
||||||
|
- Adjusted installation instructions for clarity.
|
||||||
|
- Added a new command-line interface example.
|
||||||
|
- Enhanced section on error handling with illustrative examples.
|
||||||
|
- Simplified integration guidelines with web servers using Express.
|
||||||
|
|
||||||
|
## 2025-01-14 - 1.0.7 - fix(core)
|
||||||
|
Improve error messages in renderText and listFonts methods
|
||||||
|
|
||||||
|
- Improved error handling in renderText and listFonts methods
|
||||||
|
- Ensure proper rejection messages during errors
|
||||||
|
|
||||||
## 2025-01-14 - 1.0.6 - fix(core)
|
## 2025-01-14 - 1.0.6 - fix(core)
|
||||||
Update .gitignore to improve ignored paths
|
Update .gitignore to improve ignored paths
|
||||||
|
|
||||||
|
@ -10,15 +10,22 @@
|
|||||||
"githost": "code.foss.global",
|
"githost": "code.foss.global",
|
||||||
"gitscope": "push.rocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "beautyfiglet",
|
"gitrepo": "beautyfiglet",
|
||||||
"description": "A Node.js module for creating figlet text displays.",
|
"description": "A Node.js module for creating customizable ASCII art using figlet with options for different fonts and layouts.",
|
||||||
"npmPackagename": "@push.rocks/beautyfiglet",
|
"npmPackagename": "@push.rocks/beautyfiglet",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"ASCII art",
|
||||||
"figlet",
|
"figlet",
|
||||||
"text display",
|
"text rendering",
|
||||||
"Node.js",
|
"font customization",
|
||||||
"npm module",
|
"Node.js module",
|
||||||
"typescript"
|
"typescript",
|
||||||
|
"command-line interface",
|
||||||
|
"error handling",
|
||||||
|
"web integration",
|
||||||
|
"npm package",
|
||||||
|
"testing",
|
||||||
|
"synchronous rendering"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
19
package.json
19
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/beautyfiglet",
|
"name": "@push.rocks/beautyfiglet",
|
||||||
"version": "1.0.6",
|
"version": "1.0.10",
|
||||||
"description": "A Node.js module for creating figlet text displays.",
|
"description": "A Node.js module for creating customizable ASCII art using figlet with options for different fonts and layouts.",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./dist_ts/index.js"
|
".": "./dist_ts/index.js"
|
||||||
},
|
},
|
||||||
@ -22,11 +22,18 @@
|
|||||||
"url": "https://code.foss.global/push.rocks/beautyfiglet.git"
|
"url": "https://code.foss.global/push.rocks/beautyfiglet.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"ASCII art",
|
||||||
"figlet",
|
"figlet",
|
||||||
"text display",
|
"text rendering",
|
||||||
"Node.js",
|
"font customization",
|
||||||
"npm module",
|
"Node.js module",
|
||||||
"typescript"
|
"typescript",
|
||||||
|
"command-line interface",
|
||||||
|
"error handling",
|
||||||
|
"web integration",
|
||||||
|
"npm package",
|
||||||
|
"testing",
|
||||||
|
"synchronous rendering"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.2.0",
|
"@git.zone/tsbuild": "^2.2.0",
|
||||||
|
@ -1 +0,0 @@
|
|||||||
|
|
296
readme.md
296
readme.md
@ -1,10 +1,9 @@
|
|||||||
```markdown
|
|
||||||
# @push.rocks/beautyfiglet
|
# @push.rocks/beautyfiglet
|
||||||
figlet display in nodejs
|
A Node.js module that facilitates the creation of ASCII art using figlet with customizable fonts and layouts.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
To install `@push.rocks/beautyfiglet`, you need to have Node.js and npm installed on your machine. Then, you can install it via npm:
|
To install `@push.rocks/beautyfiglet`, ensure you have Node.js along with npm set up on your machine. Executing the following command in your terminal will install this module via npm:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install @push.rocks/beautyfiglet
|
npm install @push.rocks/beautyfiglet
|
||||||
@ -15,12 +14,12 @@ Alternatively, you can add it as a dependency in your `package.json`:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/beautyfiglet": "^1.0.3"
|
"@push.rocks/beautyfiglet": "^1.0.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run:
|
Then execute:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install
|
npm install
|
||||||
@ -28,315 +27,208 @@ npm install
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The `@push.rocks/beautyfiglet` package is designed to allow you to display figlet text in your nodejs application. Below are instructions and examples on how to use it efficiently in your projects. We will cover all functionalities and illustrate several practical scenarios.
|
`@push.rocks/beautyfiglet` is a comprehensive Node.js package that empowers developers to generate visually engaging figlet-style ASCII art. This section will delve into detailed use-case scenarios, ensuring you have a robust understanding of how to integrate and utilize this module effectively within your projects.
|
||||||
|
|
||||||
### Basic Usage
|
### Getting Started
|
||||||
|
|
||||||
First, you'll need to import the package. Here's an example of basic usage:
|
To begin using `@push.rocks/beautyfiglet`, import the `BeautyFiglet` class in your TypeScript file. This class serves as the gateway to generating your ASCII art.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import * as beautyfiglet from '@push.rocks/beautyfiglet';
|
import { BeautyFiglet } from '@push.rocks/beautyfiglet';
|
||||||
|
|
||||||
console.log(beautyfiglet.standardExport); // Outputs: Hi there! :) This is an exported string
|
console.log('Welcome to BeautyFiglet!'); // Outputs: Welcome to BeautyFiglet!
|
||||||
```
|
```
|
||||||
|
|
||||||
### Creating Figlet Text
|
### Rendering Text with Figlet
|
||||||
|
|
||||||
Let’s say you want to display custom figlet text. Follow these steps:
|
The quintessential feature of this module is its ability to convert plain text into ASCII art using popular figlet formats. Below is an example of how to achieve this with `renderDefault`.
|
||||||
|
|
||||||
1. Import `figlet` from the figlet package, which `@push.rocks/beautyfiglet` might internally use.
|
|
||||||
2. Use the `figlet` function to create ASCII art.
|
|
||||||
|
|
||||||
Here is a simple example:
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import figlet from 'figlet';
|
|
||||||
|
|
||||||
figlet('Hello World', function(err, data) {
|
|
||||||
if (err) {
|
|
||||||
console.error('Something went wrong...');
|
|
||||||
console.dir(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(data);
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
### Using Promises
|
|
||||||
|
|
||||||
To work with promises and async/await, you can wrap the `figlet` method within a Promise:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import figlet from 'figlet';
|
|
||||||
|
|
||||||
const renderFiglet = (text: string): Promise<string> => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
figlet(text, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Usage example
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
const figletText = await BeautyFiglet.renderDefault('Hello, World!');
|
||||||
const figletText = await renderFiglet('Hello World');
|
console.log(figletText); // Displays "Hello, World!" in ASCII format using the default font.
|
||||||
console.log(figletText);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
### Customizing Fonts
|
### Custom Font Selection
|
||||||
|
|
||||||
Figlet allows for a variety of fonts to customize the output text. Here is how you can specify a font:
|
One of the striking features of `BeautyFiglet` is the ability to select from a variety of fonts. This allows for a unique representation of your text.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import figlet from 'figlet';
|
|
||||||
|
|
||||||
const renderFiglet = (text: string, font: string): Promise<string> => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
figlet.text(text, { font }, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Usage example
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
const customFiglet = await BeautyFiglet.renderText('Beautiful Text', 'Ghost');
|
||||||
const figletText = await renderFiglet('Hello World', 'Ghost');
|
console.log(customFiglet); // Renders the text "Beautiful Text" with the Ghost style.
|
||||||
console.log(figletText);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available Fonts
|
### Exploring Available Fonts
|
||||||
|
|
||||||
To see the list of available fonts, you can use `figlet.fonts` method. Here’s how to get a list of all fonts:
|
Knowing which fonts you can work with enhances your creative freedom. By listing available fonts, you can make informed choices.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import figlet from 'figlet';
|
(async () => {
|
||||||
|
const fontsList = await BeautyFiglet.listFonts();
|
||||||
figlet.fonts((err, fonts) => {
|
console.log('Available Fonts:');
|
||||||
if (err) {
|
console.log(fontsList.join(', ')); // Lists all fonts available for use in figlet.
|
||||||
console.error(err);
|
})();
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(fonts);
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Text Layout Options
|
### Custom Text Layouts
|
||||||
|
|
||||||
You can also customize text layout with `horizontalLayout` and `verticalLayout` options:
|
Layouts, which refer to the arrangement of text, can be customized. Modify the horizontal and vertical layouts for dynamic artistry.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import figlet from 'figlet';
|
import figlet from 'figlet';
|
||||||
|
|
||||||
const renderFiglet = (text: string, font: string, hLayout: string, vLayout: string): Promise<string> => {
|
const renderCustomLayout = (text: string, font: string, hLayout: string, vLayout: string): Promise<string> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
figlet.text(text, { font, horizontalLayout: hLayout, verticalLayout: vLayout }, (err, data) => {
|
figlet.text(text, { font, horizontalLayout: hLayout, verticalLayout: vLayout }, (err, data) => {
|
||||||
if (err) {
|
if (err) reject(`Error: ${err.message}`);
|
||||||
reject(err);
|
else resolve(data);
|
||||||
} else {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Usage example
|
// Application Example
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const figletText = await renderFiglet('Hello World', 'Ghost', 'full', 'default');
|
const customLayoutText = await renderCustomLayout('Creative Layout', 'Ghost', 'full', 'full');
|
||||||
console.log(figletText);
|
console.log(customLayoutText); // Renders with specified layout adjustments.
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
### Synchronous Usage
|
### Synchronous Text Rendering
|
||||||
|
|
||||||
To generate Figlet text synchronously, use `figlet.textSync` method:
|
For scenarios demanding immediate rendering results, such as testing or small scripts, `textSync` is a beneficial synchronous method.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import figlet from 'figlet';
|
import { figlet } from '@push.rocks/beautyfiglet.plugins';
|
||||||
|
|
||||||
const figletText = figlet.textSync('Hello World', {
|
const artwork = figlet.textSync('Synchronicity!', {
|
||||||
font: 'Ghost',
|
font: 'Standard',
|
||||||
horizontalLayout: 'default',
|
horizontalLayout: 'default',
|
||||||
verticalLayout: 'default'
|
verticalLayout: 'default'
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(figletText);
|
console.log(artwork); // Output is rendered immediately without asynchronous behavior.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Styling and Coloring
|
### Adding Color to the Output
|
||||||
|
|
||||||
While `figlet` itself doesn’t support colored text directly, you can use other npm packages like `chalk` to add colors to figlet text. Here’s an example:
|
To create more vibrant and visually appealing text displays, utilize libraries such as `chalk` to incorporate colors.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import figlet from 'figlet';
|
import figlet from 'figlet';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
|
|
||||||
const renderFiglet = (text: string, font: string): Promise<string> => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
figlet.text(text, { font }, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Usage example
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
const colorizedText = await BeautyFiglet.renderText('Color Me Beautiful', 'Standard');
|
||||||
const figletText = await renderFiglet('Hello World', 'Ghost');
|
console.log(chalk.magentaBright(colorizedText)); // Renders ASCII art in bright magenta.
|
||||||
console.log(chalk.blue(figletText));
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
### Error Handling
|
### Robust Error Handling
|
||||||
|
|
||||||
Handling errors properly is crucial for robust applications. Here’s an example of how you can handle errors comprehensively:
|
Effectively managing potential errors (e.g., when a specified font is unavailable) is essential to prevent application crashes.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import figlet from 'figlet';
|
|
||||||
|
|
||||||
const renderFiglet = (text: string, font: string): Promise<string> => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
figlet.text(text, { font }, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
reject(new Error(`Error generating figlet text: ${err.message}`));
|
|
||||||
} else {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Usage example
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const figletText = await renderFiglet('Hello World', 'InvalidFontName');
|
const result = await BeautyFiglet.renderText('Error Test', 'NonExistentFont');
|
||||||
console.log(figletText);
|
console.log(result);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error.message); // Output: Error generating figlet text: Font not found
|
console.error(`Caught an error: ${error}`); // Captures and logs errors without halting the program.
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
### Integration with Web Servers
|
### Web Server Integration
|
||||||
|
|
||||||
You can integrate `@push.rocks/beautyfiglet` with a Node.js web server like Express. Here’s an example:
|
The functionality of this module can be extended to serve ASCII art over HTTP, allowing integration with web services. Here’s a demonstration using Express.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import figlet from 'figlet';
|
import { BeautyFiglet } from '@push.rocks/beautyfiglet';
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
const renderFiglet = (text: string, font: string): Promise<string> => {
|
app.get('/api/art/:text', async (req, res) => {
|
||||||
return new Promise((resolve, reject) => {
|
const textToRender = req.params.text;
|
||||||
figlet.text(text, { font }, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
app.get('/figlet/:text', async (req, res) => {
|
|
||||||
const { text } = req.params;
|
|
||||||
try {
|
try {
|
||||||
const figletText = await renderFiglet(text, 'Standard');
|
const asciiArt = await BeautyFiglet.renderDefault(textToRender);
|
||||||
res.send(`<pre>${figletText}</pre>`);
|
res.send(`<pre>${asciiArt}</pre>`); // Sends the rendered ASCII art in a preformatted text block over HTTP.
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
res.status(500).send(error.message);
|
res.status(500).send(`Error: ${error.message}`); // Manages errors with a 500 Internal Server Error status code.
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(3000, () => {
|
app.listen(4000, () => {
|
||||||
console.log('Server started on port 3000');
|
console.log('Server running at http://localhost:4000/');
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### CLI Tool Example
|
### Command-Line Interface (CLI)
|
||||||
|
|
||||||
You can also create a command-line tool using `@push.rocks/beautyfiglet`. Here’s an example using Node.js:
|
Creating a CLI tool enhances accessibility, allowing direct ASCII art generation from the terminal. Here's a demonstration:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import figlet from 'figlet';
|
import { BeautyFiglet } from '@push.rocks/beautyfiglet';
|
||||||
import { program } from 'commander';
|
import { Command } from 'commander';
|
||||||
|
|
||||||
|
const program = new Command();
|
||||||
|
program.version('1.0.8');
|
||||||
|
|
||||||
program
|
program
|
||||||
.version('1.0.0')
|
.option('-t, --text <text>', 'Text to render')
|
||||||
.description('A simple Node CLI for generating Figlet text')
|
.option('-f, --font <font>', 'Font for rendering', 'Standard')
|
||||||
.option('-t, --text <text>', 'Text to render as Figlet')
|
.action(async (cmd) => {
|
||||||
.option('-f, --font <font>', 'Font to use', 'Standard');
|
try {
|
||||||
|
const asciiArt = await BeautyFiglet.renderText(cmd.text, cmd.font);
|
||||||
|
console.log(asciiArt); // Renders text directly in CLI using specified options.
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
program.parse(process.argv);
|
program.parse(process.argv);
|
||||||
|
|
||||||
const options = program.opts();
|
|
||||||
|
|
||||||
figlet.text(options.text, { font: options.font }, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
console.error('Something went wrong...');
|
|
||||||
console.error(err.message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(data);
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To use this script as a CLI tool:
|
**CLI Tool Usage:**
|
||||||
|
|
||||||
1. Save the script as `figlet-cli.ts`.
|
1. Save the script as `beautyfiglet-cli.ts`.
|
||||||
2. Add a line to your `package.json` to register this as a bin command:
|
2. Make it executable:
|
||||||
|
|
||||||
```json
|
|
||||||
"bin": {
|
|
||||||
"figlet-cli": "./path/to/figlet-cli.ts"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Make sure `figlet-cli.ts` is executable:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
chmod +x ./path/to/figlet-cli.ts
|
chmod +x ./beautyfiglet-cli.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Then you can run:
|
3. Establish a link via npm:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm link
|
npm link
|
||||||
figlet-cli --text "Hello World"
|
|
||||||
```
|
```
|
||||||
This concludes the extensive usage documentation for the @push.rocks/beautyfiglet package, showcasing multiple ways to generate ASCII art using figlet in Node.js. Explore the various options and configurations to best fit your project's needs.
|
|
||||||
|
4. Run the command using:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
beautyfiglet-cli --text "Hello World" --font "Ghost"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This CLI approach demonstrates seamless integration into development workflows, adding simplicity and efficiency for users.
|
||||||
|
|
||||||
|
### Comprehensive Summary
|
||||||
|
|
||||||
|
Throughout this comprehensive guide, we have demonstrated the varied and extensive capabilities of the `@push.rocks/beautyfiglet` module. From initializing the module and employing basic rendering to exploring intricate font customization, layout configurations, and error handling, the guide has covered an exhaustive list of functionalities available within this versatile module.
|
||||||
|
|
||||||
|
Developers are encouraged to delve deeper into exploring font selections and engaging with additional configuration settings to thoroughly harness the potential of this tool. By integrating colorful text arrangements and utilizing robust error management, applications can balance both aesthetic appeal and operational reliability.
|
||||||
|
|
||||||
|
This expansive exploration into the `@push.rocks/beautyfiglet` module underscores the creativity and potential this tool offers for implementing ASCII art in your Node.js projects.
|
||||||
|
|
||||||
## License and Legal Information
|
## License and Legal Information
|
||||||
|
|
||||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||||
|
@ -9,8 +9,9 @@ tap.test('setup', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should render text with the default font', async () => {
|
tap.test('should render text with the default font', async () => {
|
||||||
const text = "Hello, World!";
|
const text = "serve.zone";
|
||||||
const result = await testFiglet.renderDefault(text);
|
const result = await testFiglet.renderDefault(text, '');
|
||||||
|
console.log(result);
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -18,6 +19,7 @@ tap.test('should render text with a specific font', async () => {
|
|||||||
const text = "Fancy Text";
|
const text = "Fancy Text";
|
||||||
const font = "Ghost";
|
const font = "Ghost";
|
||||||
const result = await testFiglet.renderText(text, font);
|
const result = await testFiglet.renderText(text, font);
|
||||||
|
console.log(result);
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/beautyfiglet',
|
name: '@push.rocks/beautyfiglet',
|
||||||
version: '1.0.6',
|
version: '1.0.10',
|
||||||
description: 'A Node.js module for creating figlet text displays.'
|
description: 'A Node.js module for creating customizable ASCII art using figlet with options for different fonts and layouts.'
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user