Socket
Socket
Sign inDemoInstall

aligns

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aligns

align array or table(2D array)


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Install size
970 kB
Created
Weekly downloads
 

Readme

Source

npm package

build status Coverage Status Dependency Status NPM download NPM quality

Aligns

A tool to align array or table

Table of Contents

Installation

$ npm install aligns

Usage

Align an array

const align = require('aligns');

const xs = ['Ludwig van Beethoven', 'Beyond', 'Michael Jackson', 'Wolfgang Amadeus Mozart'];
const aligned = align.alignLeft(0, xs);

/*
[ 'Ludwig van Beethoven   ',
  'Beyond                 ',
  'Taylor Swift           ',
  'Wolfgang Amadeus Mozart' ]
*/

Align a table

const align = require('aligns');

const xss = [
  ['Ludwig van Beethoven', 'Wolfgang Amadeus Mozart'],
  ['Symphony No.9 in D minor op.125', 'Le nozze di Figaro K.492'],
  ['Symphony No.5 in C minor op.67', 'Serenade No.13 K.525']
];
const aligned = align.alignTableL(xss);

/*
[ [ 'Ludwig van Beethoven           ','Wolfgang Amadeus Mozart ' ],
  [ 'Symphony No.9 in D minor op.125','Le nozze di Figaro K.492' ],
  [ 'Symphony No.5 in C minor op.67 ','Serenade No.13 K.525    ' ] ]
*/

API

Align.left(indent, xs)

Align an array of String to left.

Align.right(indent, xs)

Align an array of String to right.

Align.center(indent, xs)

Align an array of String to center.

Align.tableL(xss)

  • xss <Array> 2D array of String

Align each column to left.

Align.tableR(xs)

  • xss <Array> 2D array of String

Align each column to right.

Align.table(xs)

  • xss <Array> 2D array of String

Align each column to center.

Keywords

FAQs

Last updated on 13 Sep 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc