diff --git a/changelog.md b/changelog.md index c4ea4ac..b05af43 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 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 diff --git a/npmextra.json b/npmextra.json index 4130ea0..c91928f 100644 --- a/npmextra.json +++ b/npmextra.json @@ -10,20 +10,22 @@ "githost": "code.foss.global", "gitscope": "push.rocks", "gitrepo": "beautyfiglet", - "description": "A Node.js module that facilitates the creation of ASCII art using figlet with customizable fonts and layouts.", + "description": "A Node.js module for creating customizable ASCII art using figlet with options for different fonts and layouts.", "npmPackagename": "@push.rocks/beautyfiglet", "license": "MIT", "keywords": [ "ASCII art", "figlet", "text rendering", + "font customization", "Node.js module", "typescript", - "font customization", "command-line interface", "error handling", "web integration", - "npm package" + "npm package", + "testing", + "synchronous rendering" ] } }, diff --git a/package.json b/package.json index 944321a..b7814be 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@push.rocks/beautyfiglet", "version": "1.0.8", - "description": "A Node.js module that facilitates the creation of ASCII art using figlet with customizable fonts and layouts.", + "description": "A Node.js module for creating customizable ASCII art using figlet with options for different fonts and layouts.", "exports": { ".": "./dist_ts/index.js" }, @@ -25,13 +25,15 @@ "ASCII art", "figlet", "text rendering", + "font customization", "Node.js module", "typescript", - "font customization", "command-line interface", "error handling", "web integration", - "npm package" + "npm package", + "testing", + "synchronous rendering" ], "devDependencies": { "@git.zone/tsbuild": "^2.2.0", @@ -40,4 +42,4 @@ "@git.zone/tstest": "^1.0.90", "@push.rocks/tapbundle": "^5.5.4" } -} +} \ No newline at end of file diff --git a/readme.hints.md b/readme.hints.md index 0519ecb..e69de29 100644 --- a/readme.hints.md +++ b/readme.hints.md @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/readme.md b/readme.md index 135144a..71b5ad4 100644 --- a/readme.md +++ b/readme.md @@ -1,20 +1,20 @@ # @push.rocks/beautyfiglet -A Node.js module for creating figlet text displays. +A Node.js module that facilitates the creation of ASCII art using figlet with customizable fonts and layouts. ## Install -To install `@push.rocks/beautyfiglet`, you should have Node.js and npm installed on your machine. Once you have these prerequisites, you can install the package via npm by running the following command in your terminal: +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 npm install @push.rocks/beautyfiglet ``` -Alternatively, you can include it as a dependency in your `package.json` file: +Alternatively, you can add it as a dependency in your `package.json`: ```json { "dependencies": { - "@push.rocks/beautyfiglet": "^1.0.7" + "@push.rocks/beautyfiglet": "^1.0.8" } } ``` @@ -27,56 +27,55 @@ npm install ## Usage -`@push.rocks/beautyfiglet` is a versatile Node.js module that lets you generate figlet-style ASCII art easily. Below, we will explore its functionalities with detailed examples, encompassing various scenarios to showcase how you can leverage this module in your projects. +`@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 Initialization +### Getting Started -Begin by importing the `BeautyFiglet` class into your TypeScript file. You can access its methods to create ASCII art from text strings. +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 import { BeautyFiglet } from '@push.rocks/beautyfiglet'; -// A simple demonstration of using the standard export console.log('Welcome to BeautyFiglet!'); // Outputs: Welcome to BeautyFiglet! ``` ### Rendering Text with Figlet -Figlet is immensely popular for turning strings into ASCII banners. The following code illustrates how to convert text into a figlet display using `BeautyFiglet`. +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`. ```typescript (async () => { const figletText = await BeautyFiglet.renderDefault('Hello, World!'); - console.log(figletText); + console.log(figletText); // Displays "Hello, World!" in ASCII format using the default font. })(); ``` -### Customizing Font +### Custom Font Selection -`BeautyFiglet` not only supports different versions of text layouts, but it also allows you to specify fonts, making your output unique. +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 (async () => { const customFiglet = await BeautyFiglet.renderText('Beautiful Text', 'Ghost'); - console.log(customFiglet); + console.log(customFiglet); // Renders the text "Beautiful Text" with the Ghost style. })(); ``` -### Fetching Available Fonts +### Exploring Available Fonts -Understanding what fonts are available can help in making aesthetic decisions for your text. +Knowing which fonts you can work with enhances your creative freedom. By listing available fonts, you can make informed choices. ```typescript (async () => { const fontsList = await BeautyFiglet.listFonts(); console.log('Available Fonts:'); - console.log(fontsList.join(', ')); + console.log(fontsList.join(', ')); // Lists all fonts available for use in figlet. })(); ``` -### Using Custom Layouts +### Custom Text Layouts -In addition to fonts, the layout of the text can be altered. You can specify both horizontal and vertical layouts. +Layouts, which refer to the arrangement of text, can be customized. Modify the horizontal and vertical layouts for dynamic artistry. ```typescript import figlet from 'figlet'; @@ -90,11 +89,11 @@ const renderCustomLayout = (text: string, font: string, hLayout: string, vLayout }); }; -// Example usage +// Application Example (async () => { try { const customLayoutText = await renderCustomLayout('Creative Layout', 'Ghost', 'full', 'full'); - console.log(customLayoutText); + console.log(customLayoutText); // Renders with specified layout adjustments. } catch (error) { console.error(error); } @@ -103,7 +102,7 @@ const renderCustomLayout = (text: string, font: string, hLayout: string, vLayout ### Synchronous Text Rendering -For situations requiring synchronous execution such as small scripts and testing scenarios, `textSync` comes in handy. +For scenarios demanding immediate rendering results, such as testing or small scripts, `textSync` is a beneficial synchronous method. ```typescript import { figlet } from '@push.rocks/beautyfiglet.plugins'; @@ -114,12 +113,12 @@ const artwork = figlet.textSync('Synchronicity!', { verticalLayout: 'default' }); -console.log(artwork); +console.log(artwork); // Output is rendered immediately without asynchronous behavior. ``` -### Enhancing Output with Color +### Adding Color to the Output -To add more flair to your text displays, consider integrating popular color-coordinating libraries like `chalk`. +To create more vibrant and visually appealing text displays, utilize libraries such as `chalk` to incorporate colors. ```typescript import figlet from 'figlet'; @@ -127,13 +126,13 @@ import chalk from 'chalk'; (async () => { const colorizedText = await BeautyFiglet.renderText('Color Me Beautiful', 'Standard'); - console.log(chalk.magentaBright(colorizedText)); + console.log(chalk.magentaBright(colorizedText)); // Renders ASCII art in bright magenta. })(); ``` ### Robust Error Handling -Error handling is paramount in any application. This becomes even more pronounced when fonts or integrations might fail. +Effectively managing potential errors (e.g., when a specified font is unavailable) is essential to prevent application crashes. ```typescript (async () => { @@ -141,14 +140,14 @@ Error handling is paramount in any application. This becomes even more pronounce const result = await BeautyFiglet.renderText('Error Test', 'NonExistentFont'); console.log(result); } catch (error) { - console.error(`Caught an error: ${error}`); + console.error(`Caught an error: ${error}`); // Captures and logs errors without halting the program. } })(); ``` ### Web Server Integration -The module can effectively serve dynamically generated ASCII text over HTTP. Here's a simple example using Express: +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 import express from 'express'; @@ -161,9 +160,9 @@ app.get('/api/art/:text', async (req, res) => { try { const asciiArt = await BeautyFiglet.renderDefault(textToRender); - res.send(`
${asciiArt}`); + res.send(`
${asciiArt}`); // Sends the rendered ASCII art in a preformatted text block over HTTP. } catch (error) { - res.status(500).send(`Error: ${error.message}`); + res.status(500).send(`Error: ${error.message}`); // Manages errors with a 500 Internal Server Error status code. } }); @@ -174,7 +173,7 @@ app.listen(4000, () => { ### Command-Line Interface (CLI) -Expand the utility of `BeautyFiglet` by creating a CLI tool for generating ASCII art directly from the command line. +Creating a CLI tool enhances accessibility, allowing direct ASCII art generation from the terminal. Here's a demonstration: ```typescript #!/usr/bin/env node @@ -182,7 +181,7 @@ import { BeautyFiglet } from '@push.rocks/beautyfiglet'; import { Command } from 'commander'; const program = new Command(); -program.version('1.0.7'); +program.version('1.0.8'); program .option('-t, --text