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

wide-align

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wide-align

A wide-character aware text alignment function for use on the console or with fixed width fonts.

  • 1.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15M
decreased by-4.12%
Maintainers
1
Weekly downloads
 
Created

What is wide-align?

The wide-align npm package is designed to align text strings in console output, taking into consideration the width of characters in environments where character width can vary (e.g., Unicode characters). It is particularly useful for creating neatly formatted console tables or aligning text in a way that accommodates wide characters.

What are wide-align's main functionalities?

Align text to the center

This feature allows you to center-align a string within a given space. It is useful for creating headers or titles in console output that are visually centered, regardless of the terminal width.

"const wideAlign = require('wide-align');\nconsole.log(wideAlign.center('Some text'));"

Align text to the left

This feature enables left alignment of a string with a specified total width. It's particularly useful for aligning text in columns where the first column's content should start at the same horizontal position.

"const wideAlign = require('wide-align');\nconsole.log(wideAlign.left('Some text', 20));"

Align text to the right

Right-aligns a string within a specified total width. This is useful for aligning numbers or any content that should be right-aligned for better readability or aesthetic reasons.

"const wideAlign = require('wide-align');\nconsole.log(wideAlign.right('Some text', 20));"

Other packages similar to wide-align

Keywords

FAQs

Package last updated on 15 Oct 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