
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@stridekick/formatters
Advanced tools
A collection of formatter functions
npm install --save-dev @stridekick/formatters
Import the formatters needed
All formatters have chainable operations (denoted by chainable)
import {DateFormatter, NumberFormatter, StringFormatter} from '@stridekick/formatters'
const dateFormatter = new DateFormatter(new Date())
const numberFormatter = new NumberFormatter(10000)
const stringFormatter = new StringFormatter('https://stridekick.com')
const stringFormatter = new StringFormatter('https://stridekick.com')
.chompLeft('https://')
.chompRight('.com')
.toString() // stridekick
Numbers can be formatted to look like currency, percentages, times, or even plain old numbers with decimal places, thousands, and abbreviations.
const numberFormatter = new NumberFormatter(10000)
Returns the result of the chained operations
API
{numberFormatter}.toString([format])
numberFormatter (required)
NumberFormatterNumberFormatterundefinedformat (optional)
stringNumberFormatter.formats.DEFAULT === 0,0NumberFormatter.formats.DEFAULTNumberFormatter.formats.TWO_DECIMAL_PLACESExample
import {NumberFormatter} from '@stridekick/formatters'
new NumberFormatter(100).toString() // 100
new NumberFormatter(1000).toString() // 1,000
new NumberFormatter(10000).toString() // 10,000
new NumberFormatter(10000.00).toString() // 10,000
new NumberFormatter(10000.10).toString() // 10,000
new NumberFormatter(10000.10).toString(NumberFormatter.formats.TWO_DECIMAL_PLACES) // 10,000.10
Named formats
DEFAULT === 0,0TWO_DECIMAL_PLACES === 0,0.00Removes prefix from start of string
API
chompLeft(string, prefix)
string (required)
stringundefinedprefix (required)
stringundefinedExample
import {string} from '@stridekick/formatters'
string.chompLeft(`http://url.com`, `http://`) // url.com
To publish updates to the npm repository:
Push all code changes to the code repository
npm install
Perform one of the following:
npm run publish:patch - {major}.{minor}.{patch +1}npm run publish:minor - {major}.{minor + 1}.0npm run publish:major - {major + 1}.0.0FAQs
A collection of formatter functions
We found that @stridekick/formatters demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.