{"_id":"format@1.0.1","bugs":{"url":"https://github.com/samsonjs/format/issues","email":"sami@samhuri.net"},"dist":{"shasum":"9ec354705434107d3a1d0b662a15e4c4a61ede05","tarball":"http://registry-npm.ywwl.com/format/download/format-1.0.1.tgz","integrity":"sha512-md5XCIq+4NhKefO+hMw6ceBjUhRABJdh4UnPsJBFhrKGho7vu0zejBpXiD0PB3gRkpFKc8iHQBV4BkS92+mXMQ==","fileCount":8,"unpackedSize":10028,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/format@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCpG9qi4JR7blcfxdMfyPM9a3WQQx7gcQ29EvDuDYfb0AIhAMhfpm6mHKDAuoUhz5hlnNE4vYaq9F9rqJSH8tOZivOG"}],"size":3988,"noattachment":false,"key":"/format/-/format-1.0.1.tgz"},"main":"./builds/format.cjs","name":"format","type":"module","types":"./types/types.d.ts","unpkg":"./builds/format.min.js","author":{"name":"Sami Samhuri","email":"sami@samhuri.net"},"module":"./src/format.js","engines":{"node":"^12.20.0 || >=14.13.0"},"exports":{".":{"import":{"types":"./types/types.d.ts","default":"./src/format.js"},"default":"./src/format.js","require":{"types":"./types/types.d.cts","default":"./builds/format.cjs"}},"./src/*":"./src/*","./builds/*":"./builds/*","./package.json":"./package.json"},"gitHead":"03054732de93018e2dae5ffc2afadfe22e729233","license":"MIT","scripts":{"test":"node --test test_format.js","build":"rollup -c --silent","prepack":"npm run build","test-min":"FORMAT_TEST_MIN=1 node --test test_format.js"},"version":"1.0.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"da5dded5-19b9-4bd9-812e-dc4e12c4d298"},"approver":{"name":"sjs","email":"sami@samhuri.net"}},"homepage":"https://samhuri.net/projects/format","jsdelivr":"./builds/format.min.js","repository":{"url":"git+https://github.com/samsonjs/format.git","type":"git"},"_npmVersion":"11.20.0","description":"printf, sprintf, and vsprintf for JavaScript","directories":{},"maintainers":[{"name":"sjs","email":"sami@samhuri.net"}],"_nodeVersion":"26.13.0","devDependencies":{"rollup":"4.67.4","@rollup/plugin-terser":"1.0.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/format_1.0.1_1794091852454_0.74316282991142"},"_hasShrinkwrap":false,"readme":"format\n======\n\nprintf, sprintf, and vsprintf for JavaScript\n\n[![version on npm](https://img.shields.io/npm/v/format.svg?style=flat-square)](https://www.npmjs.com/package/format) [![node version 12 and up](https://img.shields.io/badge/node->=12-brightgreen.svg?style=flat)](https://www.npmjs.com/package/format) [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://sjs.mit-license.org)\n\nInstallation\n============\n\n`npm install format`\n\nIn a browser without a bundler, load the minified build with a script tag. It defines `format`, `printf`, and `vsprintf` as globals.\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/format@1/builds/format.min.js\"></script>\n```\n\nUsage\n=====\n\n```js\nimport format from 'format';\n// or with CommonJS\n// const format = require('format');\nconst { printf, vsprintf } = format;\n// or if you want to keep it old school\nconst sprintf = format;\n\n// Print 'hello world'\nprintf('%s world', 'hello');\n\nconst what = 'life, the universe, and everything';\nconst out = format('%d is the answer to %s', 42, what);\nconsole.log(out);\n// => '42 is the answer to life, the universe, and everything'\n\nvsprintf('%d is the answer to %s', [42, what]);\n// => '42 is the answer to life, the universe, and everything'\n\n// you can format values as JSON with %j\nconst value = { answer: 42 };\nconst out2 = format('%j', value);\nconsole.log(out2);\n// => '{\"answer\":42}'\n```\n\nSupported format specifiers: b, c, d, f, j, o, s, x, and X.\n\nSee `man 3 printf` or `man 1 printf` for details. `j` is an extension that formats values as JSON.\n\nPrecision is supported for floating point numbers.\n\nLicense\n=======\n\nCopyright 2010 - 2026 Sami Samhuri sami@samhuri.net\n\n[MIT license](https://sjs.mit-license.org)\n","publish_time":1794091852564,"_cnpm_publish_time":1794091852564,"dist-tags":{"latest":"1.0.1"}}