Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ruxe

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ruxe

format strings into paragraphs along with text styling.

  • 1.0.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-45%
Maintainers
1
Weekly downloads
 
Created
Source

ruxe


NPM version NPM downloads

About

Ruxe is an open-source npm package used to wrap text into paragraphs for command line interfaces. It takes 2 lines of code to that. And saves you a lot of time for formatting text. You can also change paragraph colors and change the alignment of the paragraph in seconds.

Installation

npm install ruxe

Parameters

The wrap() function requires atleast 1 parameter. And maximum of 2 parameters. The first parameter is the string that you would like to turn into a paragraph. And the second parameter is a configeration object consisting of at most 3 fields. Which are -

color - Textcolor of the paragraph :string:
align - Alignment format of the paragraph :string:
separateAt - Words after which a new line is created :number:


By default color parameter is treated as white, the align parameter is treated as left and separateAt is treated as 13

Available Colors: black, red, green, yellow, blue, magenta, cyan and white
Available Alignment Formats: left and right (Center will be added in the next version.)

Example Usage

const wrap = require("ruxe");

let textwrapped = wrap("Harry has a little farm, he has 4 cows, 15 chickens and 3 goats in his farm. He likes to grow a variety of crops such as wheat, barley, rice and corn! He loves farming! He also has good storage facilities in the farm and modern irrigation systems!", { color:"cyan", separateAt:7, align:"left" }); 

console.log(textwrapped); //each line of he paragraph will have 4 words, text color will be cyan in color and alignment of the paragraph will be left.

Output:

Harry has a little farm  he has 4
cows  15 chickens and 3 goats in
his farm. He likes to grow a
variety of crops such as wheat  barley
rice and corn! He loves farming! He
also has good storage facilities in the
farm and modern irrigation systems!

For more examples click me!

Contribution

For contributing to this project, fork the repository, make the changes and open a pull request! Pull requests will be reviewed before being merged.

Keywords

FAQs

Package last updated on 09 Jul 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc