Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Small sprintf and vsprintf format specifier focused on strings. :zap:
:information_source: Notice: sprintf
and vsprintf
will treat their arguments as strings only. If you are looking for the full specification you could try sprintf.js or printj.
yarn add sprintfit
npm install sprintfit
UMD file is also available on unpkg:
<script src="https://unpkg.com/sprintfit/sprintfit.umd.min.js"></script>
You can use the library via window.sprintfit
.
Return a formatted string and accepts a variable number of arguments.
import { sprintf } from 'sprintfit'
sprintf('date: %s-%s-%s', 2018, 07, 25)
// date: 2018-07-25
Operates as sprintf()
but accepts an array of arguments.
import { vsprintf } from 'sprintfit'
vsprintf('date: %s-%s-%s', [ 2018, 07, 28 ])
// date: 2018-07-28
v8.11.3
^2.1.4
^1.1.1
^1.1.2
yarn benchmark
package | ops/sec | rme |
---|---|---|
Sprintfit | 2,601,688 | ±5.19% (77 runs sampled) |
SprintfJS | 1,117,038 | ±1.66% (60 runs sampled) |
PrintJ | 1,046,954 | ±2.78% (91 runs sampled) |
Done in 18.00s.
package | ops/sec | rme |
---|---|---|
Sprintfit | 2,774,358 | ±4.03% (79 runs sampled) |
PrintJ | 905,327 | ±3.64% (79 runs sampled) |
SprintfJS | 675,621 | ±7.06% (63 runs sampled) |
Done in 18.34s.
Feel free to send some Pull request or issue.
MIT license
© 2018 José Luis Quintana
FAQs
Small sprintf and vsprintf format specifier focused on strings.
The npm package sprintfit receives a total of 64 weekly downloads. As such, sprintfit popularity was classified as not popular.
We found that sprintfit 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.