Nexus File Manager
v2.0
π
Dashboard
β‘
System
π
βΊ
usr
βΊ
lib
βΊ
node_modules
βΊ
npm
βΊ
node_modules
βΊ
cli-columns
Quick:
β¬οΈ Parent
π Root
π Home
π WWW
π Temp
βοΈ Etc
π€ Upload
π Create
β‘ WordPress Admin
π Refresh
βοΈ test.js
β Back
import test from 'ava'; import chalk from 'chalk'; import stripAnsi from 'strip-ansi'; import columns from './index'; test('should print one column list', t => { const cols = columns(['foo', ['bar', 'baz'], ['bar', 'qux']], { width: 1 }); const expected = 'bar\n' + 'bar\n' + 'baz\n' + 'foo\n' + 'qux'; t.is(cols, expected); }); test('should print three column list', t => { const cols = columns(['foo', ['bar', 'baz'], ['bat', 'qux']], { width: 16 }); const expected = 'bar baz qux \n' + 'bat foo '; t.is(cols, expected); }); test('should print complex list', t => { const cols = columns( [ 'foo', 'bar', 'baz', chalk.cyan('εΆζζ') + ' εΎεΏε', 'blue' + chalk.bgBlue('berry'), chalk.red('apple'), 'pomegranate', 'durian', chalk.green('star fruit'), 'apricot', 'banana pineapple' ], { width: 80 } ); const expected = 'apple bar durian star fruit \n' + 'apricot baz foo εΆζζ εΎεΏε \n' + 'banana pineapple blueberry pomegranate '; t.is(stripAnsi(cols), expected); }); test('should optionally not sort', t => { const cols = columns( [ 'foo', 'bar', 'baz', chalk.cyan('εΆζζ') + ' εΎεΏε', 'blue' + chalk.bgBlue('berry'), chalk.red('apple'), 'pomegranate', 'durian', chalk.green('star fruit'), 'apricot', 'banana pineapple' ], { sort: false, width: 80 } ); const expected = 'foo εΆζζ εΎεΏε pomegranate apricot \n' + 'bar blueberry durian banana pineapple \n' + 'baz apple star fruit '; t.is(stripAnsi(cols), expected); });
π»
System Info
Current path
/usr/lib/node_modules/npm/node_modules/cli-columns
Contents
0 folders, 6 files
Disk free
99.82 GB
PHP version
8.3.30
π
Quick Actions
π Script location
π Web root
ποΈ Temp
π /usr/lib/node_modules/npm/node_modules/cli-columns
β‘ Nexus File Manager β’ 6 items