Gathering detailed insights and metrics for sprintfit
Gathering detailed insights and metrics for sprintfit
Gathering detailed insights and metrics for sprintfit
Gathering detailed insights and metrics for sprintfit
npm install sprintfit
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
51 Commits
3 Watching
9 Branches
2 Contributors
Updated on 28 Jan 2021
TypeScript (61.13%)
JavaScript (38.87%)
Cumulative downloads
Total Downloads
Last day
-65.7%
12
Compared to previous day
Last week
-30.8%
27
Compared to previous week
Last month
-5.5%
381
Compared to previous month
Last year
39.6%
4,095
Compared to previous year
25
A fast 450b sprintf & vsprintf format specifier focused on strings with no dependencies. :zap:
Note: 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.
1yarn add sprintfit
1npm install sprintfit
UMD file is also available on unpkg:
1<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.
1import { sprintf } from 'sprintfit' 2 3sprintf('date: %s-%s-%s', 2018, 07, 25) 4// date: 2018-07-25
Operates as sprintf()
but accepts an array of arguments.
1import { vsprintf } from 'sprintfit' 2 3vsprintf('date: %s-%s-%s', [ 2018, 07, 28 ]) 4// date: 2018-07-28
v8.11.3
^2.1.4
^1.1.1
^1.1.2
1yarn build 2yarn benchmark
:rocket: Try beanchmark online
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.
Node: v12.16.1
1# sprintf 21) Sprintfit: sprintf() x 2,041,472 ops/sec ±3.13% (83 runs sampled) 32) SprintfJS: sprintf() x 915,427 ops/sec ±2.79% (84 runs sampled) 43) PrintJ: sprintf() x 1,114,252 ops/sec ±3.55% (79 runs sampled) 5 6Fastest is 1) Sprintfit: sprintf() 7 8# vsprintf 91) Sprintfit: vsprintf() x 2,281,271 ops/sec ±0.52% (91 runs sampled) 102) SprintfJS: vsprintf() x 704,705 ops/sec ±2.24% (84 runs sampled) 113) PrintJ: vsprintf() x 1,193,415 ops/sec ±2.13% (83 runs sampled) 12 13Fastest is 1) Sprintfit: vsprintf() 14 15Done in 36.05s.
Feel free to send some Pull request or issue.
MIT license
© 2018-present Jose Quintana
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
77 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More