{"name":"format","version":"1.0.0","author":{"name":"Sami Samhuri","email":"sami@samhuri.net"},"license":"MIT","_id":"format@1.0.0","maintainers":[{"name":"sjs","email":"sami@samhuri.net"}],"homepage":"https://samhuri.net/projects/format","bugs":{"url":"https://github.com/samsonjs/format/issues","email":"sami@samhuri.net"},"dist":{"shasum":"5a0f213fb3da7a26d52a5ebf7f05c24b8c87a516","tarball":"http://registry-npm.ywwl.com/format/download/format-1.0.0.tgz","fileCount":8,"integrity":"sha512-Ma0z75TIs2onl3s8jQWe2AZei5UVdzsG/nACfd9EzRWFQA2KyPT0zni38hr9X5Pj17ZhaTFE31D4VDmYPBtL/g==","signatures":[{"sig":"MEQCIGncka1c6cQAfWYC0nbWb/SLA5o+w4qAfHGWUV72NIhUAiAVEIyWmiD4c+nYNMaQAEsgk4x5D2jbbo3VuDnbedrSWQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQC/PznFMR8Gte/4lQFcK5fVfdvt+zZpCwX9U5o5J499wQIgBmjbpQZeJRIpLWX4q0aOoDdaW0UBt0MoTIiS5TstZq0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10022,"size":3964,"noattachment":false,"key":"/format/-/format-1.0.0.tgz"},"main":"./builds/format.cjs","type":"module","types":"./types/types.d.ts","unpkg":"./builds/format.min.js","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":"26638bd6f5c0eb305fa04846b6301fb56cc719e5","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"},"_npmUser":{"name":"sjs","email":"sami@samhuri.net"},"jsdelivr":"./builds/format.min.js","repository":{"url":"git://github.com/samsonjs/format.git","type":"git"},"_npmVersion":"11.17.0","description":"printf, sprintf, and vsprintf for JavaScript","directories":{},"_nodeVersion":"26.4.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"4.67.4","@rollup/plugin-terser":"1.0.2"},"_npmOperationalInternal":{"tmp":"tmp/format_1.0.0_1794086279516_0.12011790239351694","host":"s3://npm-registry-packages-npm-production"},"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":1794086279611,"_cnpm_publish_time":1794086279611,"dist-tags":{"latest":"1.0.1"}}