Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
humanize
Advanced tools
Readme
Javascript data formatter for human readability.
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'
####humanize.noConflict()#### Give control of the "humanize" variable back to its previous owner. Returns a reference to the humanize object.
####humanize.time()#### Retrieves the current time in seconds
####humanize.date(format [, timestamp / JS Date Object = new Date()])#### This is a port of php.js date and behaves exactly like PHP's 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()
####humanize.relativeTime(timestamp)#### Returns a relative time to the current time, seconds as the most granular up to years to the least granular.
####humanize.ordinal(integer)#### 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
####humanize.linebreaks(string)#### Converts a string's newlines into properly formatted html ie. one new line -> br, two new lines -> p, entire thing wrapped in p
####humanize.nl2br(string)#### Converts a string's newlines into br's
####humanize.truncatechars(string, length)#### Truncates a string to length-1 and appends '…'. If string is shorter than length, then no-op
####humanize.truncatewords(string, numWords)#### Truncates a string to only include the first numWords words and appends '…'. If string has fewer words than newWords, then no-op
FAQs
Javascript string formatter for human readability
The npm package humanize receives a total of 127,259 weekly downloads. As such, humanize popularity was classified as popular.
We found that humanize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.