parse-columns alternatives and similar modules
Based on the "Text" category.
Alternatively, view parse-columns alternatives based on common mentions on social networks and blogs.
-
nanoid
A tiny (130 bytes), secure, URL-friendly, unique string ID generator for JavaScript -
Numeral.js
A javascript library for formatting and manipulating numbers. -
Flexsearch
Next-Generation full text search library for Browser and Node.js -
Underscore.string
String manipulation helpers for javascript -
i18n-node
Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates. -
StegCloak
Hide secrets with invisible characters in plain text securely using passwords 🧙🏻♂️⭐ -
camelcase
Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar -
babelfish
human friendly i18n for javascript (node.js + browser) -
strip-indent
Strip leading whitespace from each line in a string -
string-length
Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes -
unhomoglyph
Replace all homoglyphs with base characters. Useful to detect similar strings. -
splice-string
Remove or replace part of a string like Array#splice -
hanging-indent
format a string into a hanging indent with Node.js
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of parse-columns or a related project?
README
parse-columns 
Parse text columns, like the output of Unix commands
Install
$ npm install parse-columns
Usage
$ df -kP
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/disk1 487350400 467871060 19223340 97% /
devfs 185 185 0 100% /dev
map -hosts 0 0 0 100% /net
const {promisify} = require('util');
const childProcess = require('child_process');
const parseColumns = require('parse-columns');
const execFileP = promisify(childProcess.execFile);
(async () => {
const {stdout} = await execFileP('df', ['-kP']);
console.log(parseColumns(stdout, {
transform: (item, header, columnIndex) => {
// Coerce elements in column index 1 to 3 to a number
if (columnIndex >= 1 && columnIndex <= 3) {
return Number(item);
}
return item;
}
}));
/*
[
{
Filesystem: '/dev/disk1',
'1024-blocks': 487350400,
Used: 467528020,
Available: 19566380,
Capacity: '96%',
'Mounted on': '/'
},
…
]
*/
})();
API
parseColumns(textColumns, [options])
textColumns
Type: string
Text columns to parse.
options
Type: object
separator
Type: string
Default: ' '
Separator to split columns on.
headers
Type: string[]
Headers to use instead of the existing ones.
transform
Type: Function
Transform elements.
Useful for being able to cleanup or change the type of elements.
The supplied function gets the following arguments and is expected to return the element:
element
(string)header
(string)columnIndex
(number)rowIndex
(number)
Related
- parse-columns-cli - CLI for this module
License
MIT © Sindre Sorhus
*Note that all licence references and agreements mentioned in the parse-columns README section above
are relevant to that project's source code only.