{"id":16817459,"url":"https://github.com/mike442144/aligns","last_synced_at":"2025-03-17T13:22:58.734Z","repository":{"id":57176116,"uuid":"148336708","full_name":"mike442144/aligns","owner":"mike442144","description":"align array or table(2d array)","archived":false,"fork":false,"pushed_at":"2023-03-30T14:24:50.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T12:18:11.314Z","etag":null,"topics":["align","array","column","table"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mike442144.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-11T15:11:48.000Z","updated_at":"2023-03-30T14:24:55.000Z","dependencies_parsed_at":"2022-09-04T01:21:30.138Z","dependency_job_id":null,"html_url":"https://github.com/mike442144/aligns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mike442144%2Faligns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mike442144%2Faligns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mike442144%2Faligns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mike442144%2Faligns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mike442144","download_url":"https://codeload.github.com/mike442144/aligns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244039202,"owners_count":20387835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["align","array","column","table"],"created_at":"2024-10-13T10:47:15.793Z","updated_at":"2025-03-17T13:22:58.710Z","avatar_url":"https://github.com/mike442144.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm package](https://nodei.co/npm/aligns.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/aligns/)\n\n[![build status](https://secure.travis-ci.org/mike442144/aligns.png)](https://travis-ci.org/mike442144/aligns)\n[![Coverage Status](https://coveralls.io/repos/github/mike442144/aligns/badge.svg?branch=master)](https://coveralls.io/github/mike442144/aligns?branch=master)\n[![Dependency Status](https://david-dm.org/mike442144/aligns/status.svg)](https://david-dm.org/mike442144/aligns)\n[![NPM download][download-image]][download-url]\n[![NPM quality][quality-image]][quality-url]\n\n[quality-image]: http://npm.packagequality.com/shield/aligns.svg?style=flat-square\n[quality-url]: http://packagequality.com/#?package=aligns\n[download-image]: https://img.shields.io/npm/dm/aligns.svg?style=flat-square\n[download-url]: https://npmjs.org/package/aligns\n\n# Aligns\nA tool to align array or table\n\n# Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n  + [Align an array](#align-an-array)\n  + [Align a table](#align-a-table)\n* [API](#api)\n  + [Align.left(indent, xs)](#alignleftindent-xs)\n  + [Align.right(indent, xs)](#alignrightindent-xs)\n  + [Align.center(indent, xs)](#aligncenterindent-xs)\n  + [Align.tableL(xss)](#aligntablelxss)\n  + [Align.tableR(xs)](#aligntablerxs)\n  + [Align.table(xs)](#aligntablexs)\n\n## Installation\n\n```bash\n$ npm install aligns\n```\n## Usage\n### Align an array\n\n```javascript\nconst align = require('aligns');\n\nconst xs = ['Ludwig van Beethoven', 'Beyond', 'Michael Jackson', 'Wolfgang Amadeus Mozart'];\nconst aligned = align.left(0, xs);\n\n/*\n[ 'Ludwig van Beethoven   ',\n  'Beyond                 ',\n  'Taylor Swift           ',\n  'Wolfgang Amadeus Mozart' ]\n*/\n```\n\n### Align a table\n```javascript\nconst align = require('aligns');\n\nconst xss = [\n  ['Ludwig van Beethoven', 'Wolfgang Amadeus Mozart'],\n  ['Symphony No.9 in D minor op.125', 'Le nozze di Figaro K.492'],\n  ['Symphony No.5 in C minor op.67', 'Serenade No.13 K.525']\n];\nconst aligned = align.tableL(xss);\n\n/*\n[ [ 'Ludwig van Beethoven           ','Wolfgang Amadeus Mozart ' ],\n  [ 'Symphony No.9 in D minor op.125','Le nozze di Figaro K.492' ],\n  [ 'Symphony No.5 in C minor op.67 ','Serenade No.13 K.525    ' ] ]\n*/\n\n```\n\n## API\n\n### Align.left(indent, xs)\n * `indent`  \u003c[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)\\\u003e\n * `xs`  \u003c[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\\\u003e\n\nAlign an array of String to left.\n \n### Align.right(indent, xs)\n * `indent`  \u003c[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)\\\u003e\n * `xs`  \u003c[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\\\u003e\n\nAlign an array of String to right.\n \n### Align.center(indent, xs)\n * `indent`  \u003c[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)\\\u003e\n * `xs`  \u003c[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\\\u003e\n\nAlign an array of String to center.\n \n### Align.tableL(xss)\n * `xss`  \u003c[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\\\u003e 2D array of String\n\nAlign each column to left.\n \n### Align.tableR(xs)\n * `xss`  \u003c[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\\\u003e 2D array of String\n \n Align each column to right.\n \n### Align.table(xs)\n * `xss`  \u003c[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\\\u003e 2D array of String\n \n Align each column to center.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmike442144%2Faligns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmike442144%2Faligns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmike442144%2Faligns/lists"}