
Research
npm Malware Targets Telegram Bot Developers with Persistent SSH Backdoors
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
@qiwi/common-formatters
Advanced tools
Common string formatters
There's no such thing as universal formatters collection, but ... Ha, and this one library is just a set of several controversial workarounds. What can be said in defense? Smaller is better.
import {formatMoney, formatNumber, formatCardPan, formatPhone, formatPercent} from '@qiwi/common-formatters'
formatMoney(12345.6789) // '12 345,68'
formatMoney(12300.45, {currencyCode: 'RUB', fractionDelimiter: '.'}) // '12 300.45 ₽'
formatMoney(123.45, {currencySymbol: 'Foo'}) // '123,45 Foo'
// Available opts
{
strict?: boolean
digitDelimiter?: string
fractionDelimiter?: string
fractionLength?: number
currencyCode?: string
currencySymbol?: string
currencyPosition?: 'left' | 'right'
currencySpacer?: string
sign?: boolean
fractionRemoveZeros?: boolean
}
formatNumber(12345.6789) // '12 345,6789'
formatNumber(12345.6789, {digitDelimiter: ',', fractionDelimiter: '.'}) // '12,345.6789'
// Opts
{
digitDelimiter: string;
fractionDelimiter: string;
fractionLength?: number;
strict: boolean;
sign: boolean;
}
formatPercent(0.123) // '12,30%'
formatPercent(567, {sign: true, fractionLength: 0}) // '56 700%'
// Opts
{
strict: boolean;
digitDelimiter: string;
fractionDelimiter: string;
fractionLength: number;
multiplier: number;
sign: boolean;
}
// Basic cases
formatPhone('1234567') // 123-45-67
formatPhone('12345678') // 1234-5678
formatPhone('12345') // 1-23-45
formatPhone('1234567890') // 1234567890
// Format by mask
formatPhone('79876543210', {mask: '+* *** ***-**-**'}) // +7 987 654-32-10
// Format by opts
formatPhone('223344', {countryCode: '7', areaCode: '8443', areaBrackets: true, phoneNumberDelimiter: '_'}) // +7 (8443) 22_33_44
// Opts
{
blocksDelimiter: string;
countryCode: string;
areaCode: string;
areaBrackets: boolean;
areaCodeLength: number;
countryCodePrefix: string;
countryCodeLength: number;
phoneNumberLength: number;
phoneNumberDelimiter: string;
mask: string;
}
formatCardPan('1234567812345678', {digitDelimiter: '-'}) // '1234-5678-1234-5678'
FAQs
Common string formatters
The npm package @qiwi/common-formatters receives a total of 58 weekly downloads. As such, @qiwi/common-formatters popularity was classified as not popular.
We found that @qiwi/common-formatters demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Research
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.