humanize alternatives and similar modules
Based on the "Humanize" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of humanize or a related project?
Idea, name, and initial code blatently stolen from milanvrekic/JS-humanize
Can be loaded via AMD or in node directly.
npm install humanize
var humanize = require('humanize'); humanize.date('Y-m-d'); // 'yyyy-mm-dd' humanize.filesize(1234567890); // '1.15 Gb'
Give control of the "humanize" variable back to its previous owner. Returns a reference to the humanize object.
Retrieves the current time in seconds
humanize.date(format [, timestamp / JS Date Object = new Date()])
humanize.numberFormat(number [, decimals = 2, decPoint = '.', thousandsSep = ','])
Format a number to have decimal significant decimal places, using decPoint as the decimal separator, and thousandsSep as thousands separater
humanize.naturalDay(timestamp [, format = 'Y-m-d'])
Returns 'today', 'tomorrow' or 'yesterday', as appropriate, otherwise format the date using the passed format with humanize.date()
Returns a relative time to the current time, seconds as the most granular up to years to the least granular.
Converts a number into its ordinal representation.
humanize.filesize(filesize [, kilo = 1024, decimals = 2, decPoint = '.', thousandsSep = ','])
Converts a byte count to a human readable value using kilo as the basis, and numberFormat formatting
Converts a string's newlines into properly formatted html ie. one new line -> br, two new lines -> p, entire thing wrapped in p
Converts a string's newlines into br's
Truncates a string to length-1 and appends '…'. If string is shorter than length, then no-op
Truncates a string to only include the first numWords words and appends '…'. If string has fewer words than numWords, then no-op