@arcjet/sprintf
Advanced tools
+5
-5
| { | ||
| "name": "@arcjet/sprintf", | ||
| "version": "1.3.0", | ||
| "version": "1.3.1", | ||
| "description": "Arcjet platform-independent replacement for util.format", | ||
@@ -47,7 +47,7 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@arcjet/eslint-config": "1.3.0", | ||
| "@arcjet/rollup-config": "1.3.0", | ||
| "@rollup/wasm-node": "4.57.1", | ||
| "@arcjet/eslint-config": "1.3.1", | ||
| "@arcjet/rollup-config": "1.3.1", | ||
| "@rollup/wasm-node": "4.59.0", | ||
| "@types/node": "24.11.0", | ||
| "eslint": "9.39.2", | ||
| "eslint": "9.39.3", | ||
| "typescript": "5.9.3" | ||
@@ -54,0 +54,0 @@ }, |
+28
-0
@@ -0,1 +1,3 @@ | ||
| <!-- trunk-ignore-all(markdownlint/MD001) --> | ||
| <a href="https://arcjet.com" target="_arcjet-home"> | ||
@@ -58,2 +60,26 @@ <picture> | ||
| ## API | ||
| This package exports the identifier | ||
| [`sprintf`][api-sprintf]. | ||
| The default export is also [`sprintf`][api-sprintf]. | ||
| This package exports no [TypeScript][] types. | ||
| ### `sprintf(template, …values)` | ||
| Formats a string by replacing placeholders with the provided values. See | ||
| [Substitutions](#substitutions) below for the supported placeholder types. | ||
| ###### Parameters | ||
| - `template` (`string`) | ||
| — the format string with placeholders | ||
| - `values` (`Array<unknown>`) | ||
| — values to interpolate into the template | ||
| ###### Returns | ||
| The formatted string (`string`). | ||
| ## Substitutions | ||
@@ -86,2 +112,3 @@ | ||
| [apache-license]: http://www.apache.org/licenses/LICENSE-2.0 | ||
| [api-sprintf]: #sprintftemplate-values | ||
| [arcjet]: https://arcjet.com | ||
@@ -91,1 +118,2 @@ [node-util]: https://nodejs.org/docs/latest-v18.x/api/util.html#utilformatformat-args | ||
| [quick-format-unescaped]: https://github.com/pinojs/quick-format-unescaped/blob/20ebf64/index.js | ||
| [typescript]: https://www.typescriptlang.org/ |
23835
3.03%117
31.46%