Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximilianschmitt/space-align
A node.js module for aligning data with spaces.
https://github.com/maximilianschmitt/space-align
Last synced: about 1 month ago
JSON representation
A node.js module for aligning data with spaces.
- Host: GitHub
- URL: https://github.com/maximilianschmitt/space-align
- Owner: maximilianschmitt
- License: mit
- Created: 2014-05-16T13:31:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-16T14:23:25.000Z (over 10 years ago)
- Last Synced: 2024-11-17T18:11:37.921Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
space-align is a node.js module for aligning data with spaces.
## Usage
### 1. Install space-align
```
npm install space-align
```### 2. Pass in your data
``` javascript
var spaceAlign = require('space-align');var data = [
['mmzVOvVYCcGaCW', 2, 'ICzVrD', 'uaUGZwvHghbtqaXCqAqS'],
['yOwPyBVGNfBlRezMzIF', 'pbpuZTSKYrnWBIy', 'ghOhMvnnjpydAjWtY', 'VEV'],
['usi', 'alZz', 'URVaQMaNsDTyKJo', 15123],
['aTmhFgdJCsjkVXAtEDyX', 35, 'AUSG', 'lHMLn']
];var alignedData = spaceAlign(data);
alignedData.forEach(function(alignedRow) {
console.log(alignedRow);
});
```### 3. See the result
```
mmzVOvVYCcGaCW 2 ICzVrD uaUGZwvHghbtqaXCqAqS
yOwPyBVGNfBlRezMzIF pbpuZTSKYrnWBIy ghOhMvnnjpydAjWtY VEV
usi alZz URVaQMaNsDTyKJo 15123
aTmhFgdJCsjkVXAtEDyX 35 AUSG lHMLn
```### 4. Options
Pass in options as the second parameter like this:
``` javascript
spaceAlign(data, {
spacing: 4 // default
});
```