{"_id":"printj","_rev":"19-f1821f7705f55b19956dfcbbfc9ac332","name":"printj","description":"Pure-JS printf","dist-tags":{"latest":"1.3.1"},"versions":{"0.1.0":{"name":"printj","version":"0.1.0","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","dependencies":{},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test"},"config":{"blanket":{"pattern":"printj.js"}},"files":["printj.js","bin/printj.njs","LICENSE","README.md"],"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"_id":"printj@0.1.0","_shasum":"ea5ff464096b95003adeab27cf21fdd4ce02452b","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"shasum":"ea5ff464096b95003adeab27cf21fdd4ce02452b","tarball":"https://registry.npmjs.org/printj/-/printj-0.1.0.tgz","integrity":"sha512-p6OEKrnFgyhwHioYKg1JcsiXFS+FwXJL1WmnUIz2U2lpVGB541iaJ3Fezp9jaq7qkDKlAf5KkJJk7jQvILNFlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJOEgcAzQ5PvOLkLdUjmGgkWof93TnuX7hiRiJGfCnHAiA5U+sleeH5U7HCY+kP4kr5FLHBSM55oSDdxz1819kypQ=="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/printj-0.1.0.tgz_1474267267293_0.4757495201192796"},"directories":{}},"0.1.1":{"name":"printj","version":"0.1.1","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","dependencies":{},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test"},"config":{"blanket":{"pattern":"printj.js"}},"files":["printj.js","bin/printj.njs","LICENSE","README.md"],"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"08a0a31128f2f7d2f9451c2688bbad79747ff8da","_id":"printj@0.1.1","_shasum":"9d07ef9db9234da8659579e468bd46a7510489b0","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"shasum":"9d07ef9db9234da8659579e468bd46a7510489b0","tarball":"https://registry.npmjs.org/printj/-/printj-0.1.1.tgz","integrity":"sha512-0zHazAFwbXcYieHiCeU9osQ50+qFRVuvTP/2VfDiSTNCjyp2C2JFLc/Kt2m323CWHNtcB0eO+MEPn4yDaGgLNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQB9TF/amrQjgEOcrWHswMbSekUn6pDshjf5ZjNb8hPQIhANyv02pJxIcYycIcjU6O5sy0InD8jP7hCG9OP4grACMX"}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/printj-0.1.1.tgz_1475948154135_0.18917139736004174"},"directories":{}},"1.0.0":{"name":"printj","version":"1.0.0","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","dependencies":{},"devDependencies":{"mocha":"","uglify-js":""},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test"},"config":{"blanket":{"pattern":"printj.js"}},"homepage":"https://oss.sheetjs.com/printj/","files":["printj.js","bin/printj.njs","LICENSE","README.md","dist/*.js","dist/*.map","dist/LICENSE"],"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"8ae1c19bfa2913d927cf0bfd535addbebaa8da24","_id":"printj@1.0.0","_shasum":"5c37de6c5772a3fed8468399c2063b5b22528867","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"shasum":"5c37de6c5772a3fed8468399c2063b5b22528867","tarball":"https://registry.npmjs.org/printj/-/printj-1.0.0.tgz","integrity":"sha512-WWGohvw/7pcv/REJuJhT3Qcj6FTu2w6Odtb6ZrcJ8qmZWKl6wzqzJJKe76KHIHa2h5+4U/PUcFKVlzJsN5jcUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1rWUE59T3bN7z2QN6NDxmPipX6PyR2e5/UrNXV7Ed3AiA5np7IdlQvh9w0gz1cAzDbimQBbsTo53eTjGmGR6rwzQ=="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/printj-1.0.0.tgz_1483584484291_0.6196892783045769"},"directories":{}},"1.0.2":{"name":"printj","version":"1.0.2","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","types":"types","dependencies":{},"devDependencies":{"mocha":"","@sheetjs/uglify-js":"","@types/node":"","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"homepage":"http://sheetjs.com/opensource","files":["printj.js","bin/printj.njs","LICENSE","README.md","dist/*.js","dist/*.map","dist/LICENSE","types/index.d.ts","types/*.json"],"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"045b316b67220bf8549ee5938b17277c9af6a71f","_id":"printj@1.0.2","_shasum":"ecb2ad8b8fdf721fbee039846c67a81eb9e4c249","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"shasum":"ecb2ad8b8fdf721fbee039846c67a81eb9e4c249","tarball":"https://registry.npmjs.org/printj/-/printj-1.0.2.tgz","integrity":"sha512-kDrIkzrrTb6+McEKsIwLcI+JTIoYXmOzEQ1WFXAgJ5iEh0WTOrq7OzA2c+LCIvHBJ0t1tKYVa7AiZdLeYJd1TA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEK0jAfQkASPfbKH+jZzp7ZilBoGKbTyXzfE8mr5LFoGAiEAnCrGe5g4W/pFK7WPt+XaWCEHm5iTN6bBvlo7lTRk37M="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj-1.0.2.tgz_1499154602861_0.30543767660856247"},"directories":{}},"1.1.0":{"name":"printj","version":"1.1.0","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","types":"types","dependencies":{},"devDependencies":{"mocha":"~2.5.3","blanket":"~1.2.3","@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"homepage":"http://sheetjs.com/opensource","files":["printj.js","bin/printj.njs","LICENSE","README.md","dist/*.js","dist/*.map","dist/LICENSE","types/index.d.ts","types/*.json"],"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"d3f373079c848ab3934ba438c9fd40b365da2a7e","_id":"printj@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"integrity":"sha512-NbiNBOQ0GioHyeD3ni8wZB7ZmfU7mxIrqhWR5XSreX3rUVvk5UOwpzxOnWqrLdCtoBbdQ40sEwC+nXxxjlUo0A==","shasum":"85487b5e8f96763b0b4a253613bef9dd9b387e3c","tarball":"https://registry.npmjs.org/printj/-/printj-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExanjG/R474EO9dEpY5GDHr/5AmZ3B64P43hCTdTLsSAiEA99Ppf813BoyZM9JWiHGfcu8pi3RuZdNMzPED3LvwUGM="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj-1.1.0.tgz_1500839192079_0.6220082517247647"},"directories":{}},"1.1.1":{"name":"printj","version":"1.1.1","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"mocha":"~2.5.3","blanket":"~1.2.3","@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["period"]},"homepage":"http://sheetjs.com/opensource","files":["printj.js","bin/printj.njs","LICENSE","README.md","dist/*.js","dist/*.map","dist/LICENSE","types/index.d.ts","types/*.json"],"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"350978bd98fcefd6f3aaecb719510a08e29d764f","_id":"printj@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"integrity":"sha512-92lwY69sNMFVtJz9GswmGEN8n5ClTJJzQflshyN1hBHRX5XWphhDWobIY6BaFPGbS4JGlMZJ0735zTijdpfRsA==","shasum":"3749360215888d460a35b683ae13dcc02c620b47","tarball":"https://registry.npmjs.org/printj/-/printj-1.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQCZboNq6utgP0LbR+snEb1PARfaEZoAr8oFPdQYWd2AiEAoYdgjrCJN3VghKtdygPRSj5mISuZz+tTJrvhOSE9PGI="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj-1.1.1.tgz_1516156823377_0.9543696141336113"},"directories":{}},"1.1.2":{"name":"printj","version":"1.1.2","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"mocha":"~2.5.3","blanket":"~1.2.3","@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["period"]},"homepage":"http://sheetjs.com/opensource","files":["printj.js","bin/printj.njs","LICENSE","README.md","dist/*.js","dist/*.map","dist/LICENSE","types/index.d.ts","types/*.json"],"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"01a9c9ecdb06475d1467b0d3e49df85bed1f9dd7","_id":"printj@1.1.2","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"integrity":"sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==","shasum":"d90deb2975a8b9f600fb3a1c94e3f4c53c78a222","tarball":"https://registry.npmjs.org/printj/-/printj-1.1.2.tgz","fileCount":12,"unpackedSize":113471,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACkV+osWgRoW0lcYFTaSldYZDhYHK3YUxgnKB5RxDfBAiEAodNB4CrsSTUIASJ/bCHJ3wETOKIfblmrTGqoTWD7Dxo="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj_1.1.2_1519169129951_0.1677008809838869"},"_hasShrinkwrap":false},"1.2.0":{"name":"printj","version":"1.2.0","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"mocha":"~2.5.3","blanket":"~1.2.3","@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["period"]},"homepage":"http://sheetjs.com/opensource","bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"e1e33f9cb6daeb055694631760d5e7e3cdd8dbcb","_id":"printj@1.2.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"integrity":"sha512-wQ6jPc72jVXX/qpP2/oDIPQ+ZJqvZGAZPm47LnBwzWTBssK1a/c9p09e/Pd1Nx4ACm+Ru86AT99nuiyOFT2zOQ==","shasum":"852fca7283cdb82f3fd08d007bde701a224cc397","tarball":"https://registry.npmjs.org/printj/-/printj-1.2.0.tgz","fileCount":13,"unpackedSize":135630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjha4CRA9TVsSAnZWagAA7VMP/iS7eLjn0knp+JFYXsLc\nHh6p/5mNrAxIvAtiSc519WQsrQnYHNMGxmlZcAEWd6HyL2yUO77XbWJGDBGh\n3qYxxgLwYHF+jTYyCSma8QfMvIlRkXgw4GM/hih5VKcN2sD6pCLLg2uNnZ00\nDSaxpPoMFDM/hgmS8apY2HDbVYMbjGu9ZZEU9FoOuPspZiJP8qiU+iQtwwqc\nCSDpgiCEsPxSThbTLySEggL0CROnC7YypXYjfGTMOvLzYjt2XYnbjqS0ipiE\nec5YtnItGQqc7LcEHAGH44slAASEk1veD1JpVeDMJxRh/CY47U7rJ7r+OpGC\n227hMcV9Yt6pd3iH5C47nj0LF+XhHfo5grrZguFlTlPSiIOs2UX/4iyaoiG4\nvFk7R42WtLWtynmkTVGzt+dvqWAt/UnVWSslfsM1yE60sXqOCutfIEXu+f8v\nh1d6pG5/tfsW8vQVOraL2Z1quhwrItcbktA4N1sTYUvoUWhXaAuQuK4Ujts5\nJuSZix/x4aLZwRBdSUWNaH8/BYEFecOceAL9XaygLSpLC2pElPp2ZB9Vsb0b\nrtZpFxcFFoTR8SLqrfbt672HChtsLVXW7rkiHFAgIK+t+aFKaxQ6cAM2HB9W\nxJku0v1INdVnDKklEPtjf4gnIqIKjKwBR430os37Pq2LKQOdZE3aRodJId3H\nLVOt\r\n=mlXb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlFJXuHT0N2fE2cEVbHmGxlp2KI9bIS9u9uqm8S92OUwIhAPqpE27WHtZzv/+Dwul7gee55/K40vZTZmcdAmDJdMQM"}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj_1.2.0_1536038583709_0.4022121303384294"},"_hasShrinkwrap":false},"1.2.1":{"name":"printj","version":"1.2.1","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","module":"./print.mjs","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"mocha":"~2.5.3","blanket":"~1.2.3","@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["period"]},"homepage":"http://sheetjs.com/opensource","bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"f04791d1e754c0af81a31827b432a09aa8a41619","_id":"printj@1.2.1","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"integrity":"sha512-VR1iadSfok+3MweY9HS2V5ExzwtS3TVvJyJUtdPc8K8dblg2m6H3YOKnlMdZlzp31AaGnM95GKhIFITo6j02OQ==","shasum":"67bdc1be9958c0690d5c35e2ba8ff70ceaac26bf","tarball":"https://registry.npmjs.org/printj/-/printj-1.2.1.tgz","fileCount":13,"unpackedSize":134674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyhFJCRA9TVsSAnZWagAAnxwP/0t8EvZtbj9FJvJIIVHs\nD2IyBkeqKD+rvjw46dOnqzb9KJRYac4+ypbWJZrTGjdUuLMETVMmYUt7TJG/\nVg52ombeDyTz3SQ0yUAuvMG/T7mlCwStrLYG7WVfTIhZapWKK9k888Wg6SPY\nsvRMrLCkN3oMDKAhH3fwTtWVPSwwqB3BsXMl80kcet2UQXRqtFkAA48ykOkO\nlpIUeaWWoYfwGPcN5E9Iq/11m61E/ZbRvzQ3BRsL/i6Rx5pwUf6LQISwPWff\nrWeEwUaQ7gnDj+iIJm/hwk8UkHO9YPBWcc86xEDvgNYyMMPFQ3/k4OLrfIrX\nQ7Qg6CpgvgQUfCcCRJRs/CbsvgSbktNfFmeNOud3rsh+NRjGxX5Wtu7pVzwl\nnabjM/O/xjwml3S/CC1sLpIrXZ9sxMDLyAABKAShg3doFwUVtM7jZ/yLQT6J\nzL3I55hHM/5N8InV0BcmXmzlMbf76otfmVFZS9HQ7NEHQVA9/6P2YuqFytob\no9jOnCrdwe+6v/7ImkHhEkW9ow+W+goPqgx/3uWgVQLWp1v4RwOlP5k3vWLH\ntPDMd6XyM9e9aZ9F5zEM2KMzE8rIDpYLwJbiQ8BP8iUjqomgMVUc7LeKychr\nnJnqDnBTermHw/Y8tJOWS39erSz2kHqmwRnQRe9cy5tQEbI9gfTPeK/i0T0E\nV2in\r\n=d5ju\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQIEwwKC2DPg6bNAmcVjBJYiGEPS1hccUcHrzfwIycBAiEAwB0HlMlp47ZCYVEf/160ngEkXuFJLuoq5MaNZCvJgQU="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj_1.2.1_1539969352448_0.4318821738249776"},"_hasShrinkwrap":false},"1.2.2":{"name":"printj","version":"1.2.2","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"./bin/printj.njs"},"main":"./printj","module":"./print.mjs","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"mocha":"~2.5.3","blanket":"~1.2.3","@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["period"]},"homepage":"http://sheetjs.com/opensource","bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"e6d6f001c5d5fe6b33ea0a62cd7c907f3c2d21fb","_id":"printj@1.2.2","_shasum":"620eb0f07509394545fe82f97fe73baa8ad86992","_from":".","_npmVersion":"2.15.11","_nodeVersion":"0.12.18","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"dist":{"shasum":"620eb0f07509394545fe82f97fe73baa8ad86992","tarball":"https://registry.npmjs.org/printj/-/printj-1.2.2.tgz","integrity":"sha512-dx9nIry0Z12s5oebhenDCFQjj/IMVotLMbvFP6OJ+C3v+EV30mtYoj6QtaulFo+DbWCbpEeaqcLYMh6CRuVjsA==","fileCount":13,"unpackedSize":133288,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdPtJHCRA9TVsSAnZWagAAS5sP+wTUDHTa9YSO4qoXS8k8\nkXPHvoXk3xYoUdD/aflCYX/KwPEbvNA4pt4ugSTSVuT6/kdw3ooiLgeS+8AV\nUCPQxAmXn+EocqmGiPmr7QyrYDFUoNW51Ba5H4dIcNX54yRCCbh4TNmR4Bmi\n7nF6O3ZH+yCtwwfXxz+Cvm84nLgmrDA57eHzWlKvQka2hxCl2prQYEW0P737\nhU18fVethxbaqkWbvaVXKLSyXwCn0mK9qVa6vbBKIO5Sm/v5bfcKRTeVXUk8\nL3g0CNYxXVGatWsnzCY3qOkxJpFhTj04hLVOBCJnwkAhWRAK1mrvIUcdbpBY\nYasMyifH0/4LhlEap1w8kEdGS90z0jBPRqbJv1wRtVQL+u8YcU7nG2o8vzuA\nxH2jAB2JuU28Q9YKpBQjSuRsFuIZJtWIvOFVeRQ2r1AFyf2iuqDTEC8efhzH\n6xF/ZZZ+maGE9PySFWDiMhcxZ4Wtyg/bBg9TphlK46y3vPDompF+UwdF5osN\nYqTNZSzKBgIMmeDVAeQirPluYn25tCqTSxk0L0H09+bBXuHnGm83KOZ6CaXO\nVj0qllH9zN+JSo3fnfH23sOjl9HUmIzFW3+pzJB2v3Qda17YJnI4544Q7URh\nkj60rEEIJXtYF2C4lo09g7yMrg7W1+Vl4AC9fEv5cMRKF5sle1/EYWtIjBX7\nNq+0\r\n=NXt1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEs9Nc/Cn0umimsxMOyTtpcV7u4pUzWzsrvTxe6AzmGwAiEAteN1x5/ZMQIAQAwclGyU1dOBgrYNhAxrMvqdXncnmjE="}]},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj_1.2.2_1564398150065_0.577431170589709"},"_hasShrinkwrap":false},"1.2.3":{"name":"printj","version":"1.2.3","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"bin/printj.njs"},"main":"./printj","module":"./printj.mjs","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"mocha":"~2.5.3","blanket":"~1.2.3","@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","dtslint":"^0.1.2","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["period"]},"homepage":"http://sheetjs.com/opensource","bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"6fb0427a3163312811e3ca9ea023d773352801bc","_id":"printj@1.2.3","_nodeVersion":"16.4.1","_npmVersion":"7.18.1","dist":{"integrity":"sha512-sanczS6xOJOg7IKDvi4sGOUOe7c1tsEzjwlLFH/zgwx/uyImVM9/rgBkc8AfiQa/Vg54nRd8mkm9yI7WV/O+WA==","shasum":"2cfb2b192a1e5385dbbe5b46658ac34aa828508a","tarball":"https://registry.npmjs.org/printj/-/printj-1.2.3.tgz","fileCount":13,"unpackedSize":154821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLENaCRA9TVsSAnZWagAAZDwP/AyL7+DMH1pb5tbWCVui\nI2p2jBisRUYA1/H1peoqPah9FM0vmsdB6O6oO9HZ8g7F4occfycq/B0U0dXN\nDtb/KzOxolb0BLxAoR2xyb4pwXi5oQmQBcuC6qAhm4/mmV3YqEBobpdg4woZ\ncgBhkrlhi0aRAsF/FnPITZ/LrzprkVFwigVSs2QATa5C0fAm0R/zrjqw3vu9\n/qUaCF/WiFspQdvbJ9M5GHM2pqwXXmcpnD6+STKolYXqk9vq2lInJczeIwiA\n/CZEqYGc8nvMOhBqloLnl80eHgbNk11yUy3xR0ifTq128Iu9slaAFSN3EgST\nNrrNjRHqw6o4loyh2X3PiOs2rJxJWielIggdFN/9DoOandmon5zf5cWQD87l\ndYAOotvKlwD0mK7XQM+/zJ6scAsHEln6OLTLCMwPj2CKY/lYNdfeVpr3ZB8U\nNPXUmbfzeb4agbWzpMKqLELC8t1oBdchdIOb0kl7zlspwC/qSPvyoTN8Sucv\n0y7WgwDq30/yCVaifQeNptsmB1/uE7e6e1ulW34x2OheourIsSjessaZH3o1\nenAubuxfka1hG7Rt/+xXuLAmX1v68YEjZLqGq7hkF8dBchC/5v3YMAjfQKYr\nP21JGSKQygbb283bTUSW+DhK4EAm13S1X4P751vrlcXCsdkvc2Nl4PrIPD2i\nWDGO\r\n=Hf+r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV6WCvD3jvq17IqiKbvYlKj6Z/+5Q67I9R5EilaBYI1AIgWUdhetk98hUp7Qbyol1k+4945mBnNc5LS5Uhw8x7F5w="}]},"_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"directories":{},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj_1.2.3_1630290778356_0.6435569525526763"},"_hasShrinkwrap":false},"1.3.0":{"name":"printj","version":"1.3.0","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"bin/printj.njs"},"main":"./printj","module":"./printj.mjs","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","blanket":"~1.2.3","dtslint":"^0.1.2","mocha":"~2.5.3","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["special","period","just","invalid"]},"homepage":"https://sheetjs.com/","bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"7847c20022b4f84507e5603a16374a09196e8972","_id":"printj@1.3.0","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"integrity":"sha512-017o8YIaz8gLhaNxRB9eBv2mWXI2CtzhPJALnQTP+OPpuUfP0RMWqr/mHCzqVeu1AQxfzSfAtAq66vKB8y7Lzg==","shasum":"9018a918a790e43707f10625d6e10187a367cff6","tarball":"https://registry.npmjs.org/printj/-/printj-1.3.0.tgz","fileCount":14,"unpackedSize":164038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLVIiCRA9TVsSAnZWagAAjlMP+wUEgjXTJxV79AO68u4I\nggNZItcyRpRLEYStiwGnvXi1VAHVNfDsXyE8aTqmrgv37BZtXoUQlsgFZmku\nCeVyGclN69r2umEN7AVou0ttxMPnSjYw66qZq8E4QwaAkfN850qnJecEg7Yo\n6k0YFm+GhVDZE329MegnyYbQzTl95/ajkW5M0CwzptAPXhbiAfRSeIqDGAVg\nCdRdhgDJDsfO3uUlmsrtMGEnSTmU+rja6Yk43fI36eBeFAHaDMUCXddpPKSG\nfilOiLtvj8iZiHLj3QLTmEdy2zWA+Y7Rb+O6D4ViC6U/CSqbe3k1OA0vbyee\nocP2yP/WxqI9rmlycGdXG/id4L0g1i0SUpXPfC9TkMjvYoU6OvPA2jiFOVyw\nXF3iIPgLNI76VY9bjw/ZtB+cQg8qcR7CVrnkMlO7iV8FTKU0Rw/tGZ3XPcw6\nvz+lSDP3xyLHHSJGAzeyLVD7za0AfbKwHAeRHKTjJznUO6R+5sAfliPRW8EG\nXSLBs9UHiuN+c1JeFlKvFg/r/ssfLvxrqRxEdqK1+dH7GLAGUmPtS6Wy2Yot\nYh0Fm13c/NQfNkUQgdH2ON9inEi18OgtAwhlKDbXXAqRTsANC2og2JOxewK/\nK0JXAmfmzJ6x+xspR0XVur1pT9YkirgKEwOvOR0lAdbahILugehfVDEyfbog\nQEKZ\r\n=1Rtk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVXKAlMfXdrGNR235YHmB4AApyUMKimGtGzQHA/+GWRAIgDJIxuIktJQdAzqRwDrElhazYhR+ftpyHsD3u5nk+EKw="}]},"_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"directories":{},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj_1.3.0_1630360098037_0.941460737370597"},"_hasShrinkwrap":false},"1.3.1":{"name":"printj","version":"1.3.1","author":{"name":"sheetjs"},"description":"Pure-JS printf","keywords":["printf","sprintf","format","string"],"bin":{"printj":"bin/printj.njs"},"main":"printj.js","module":"printj.mjs","types":"types","browser":{"process":false,"util":false},"dependencies":{},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.0.7","alex":"10.0.0","blanket":"~1.2.3","dtslint":"4.2.1","eslint":"6.8.0","eslint-plugin-html":"6.0.0","eslint-plugin-json":"1.4.0","jscs":"3.0.7","jshint":"2.9.6","markdown-spellcheck":"1.3.1","mocha":"~2.5.3"},"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"scripts":{"test":"make test","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"printj.js"}},"alex":{"allow":["whitespace","special","period","just","invalid"]},"homepage":"https://sheetjs.com/","bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"d8b2f48bd97c43049102209ba86b693b824a7f12","_id":"printj@1.3.1","_nodeVersion":"17.4.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg==","shasum":"9af6b1d55647a1587ac44f4c1654a4b95b8e12cb","tarball":"https://registry.npmjs.org/printj/-/printj-1.3.1.tgz","fileCount":14,"unpackedSize":164185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7jMGCRA9TVsSAnZWagAAsWoP/2E77iqeEL0tILyLp/So\ncdrxffxlmie54vmBUsnhj1TYud/oAj1gw5beQEKYNYYd8GXX4freA9n+/3gn\nr6di+ZT/UOg8+v6h78HzC6URswRzg4rUyV22O4umN1G83aj3kJb59tzwnj2e\njnm2VAb3upPxnoSUYTFDzrXYZTMPt7jXUyyBPmTNtO3w4/4lo6xsqtJDttJh\nnQ56YD7qHUawh8Zw3YpdrDXtjAo7GLPjv18Y9g7rzjaJL9Ozy4Tfd0TimfW4\n0feOyk86X/msrVmPOEElJMPLFH976M8r2/mQQahp88wG52MFmQx+N3JJm6ns\ngMVSlY/nfAwlqx4cfY2RXGaR7Ka6gitE/Qvp0uuqOC5GTpJUaOY290XFg1K+\nWS04WYa8/descKlCbmVfhj8DDCwaAuIDmsbw+3BEKHe3NTVsEjASVhSlAc2J\nDocOEsQbyHX8s59bN2LRbd6ijy7AO4gG82aJiOX9uVp331jw3cZB5NIlpKPZ\nQfbQFBdZa7a6JDEBKwj5LWuGV9lAlAmffJLHtdnCiyVX4OqWaudwX3icdqqZ\nhdEQGBdgrgZmevRiC4yf3geRkEetqJiRmU46bd24dfaB1dQE2AjMiE01qyYw\nPQn/clSq5IpLqrefRI7xvUVPhHO1PI88g9fYZLUcZFxtiCoyEcOkYQSB1uJv\nyGvJ\r\n=zEii\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0Cu+D6MwtaY9dzMqOOR8o6Dp7DmXZvIqo7FwBZQg+qAiEAsbhIYGqGfNXwQYnx9qvt51r8lKDJr7uFbjA3Kub2VPw="}]},"_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"directories":{},"maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/printj_1.3.1_1643000582648_0.6596363357054538"},"_hasShrinkwrap":false}},"readme":"# printj\n\nExtended `sprintf` implementation (for the browser and nodejs). Emphasis on\ncompliance, performance and IE6+ support.\n\n```js\nPRINTJ.sprintf(\"Hello %s!\", \"World\");\n```\n\nA self-contained specification of the printf format string is included below in\n[this README](#printf-format-string-specification), as well as a summary of the\n[support against various printf implementations](#support-summary)\n\n\n## Table of Contents\n\n
\n Table of Contents (click to show)\n\n\n\n * [Installation](#installation)\n + [ES Module Support](#es-module-support)\n * [Usage](#usage)\n * [Testing](#testing)\n * [License](#license)\n * [Badges](#badges)\n- [printf format string specification](#printf-format-string-specification)\n + [Original C Interface](#original-c-interface)\n + [JS and C strings](#js-and-c-strings)\n + [JS Interface](#js-interface)\n * [Specifier heritage and regular expression](#specifier-heritage-and-regular-expression)\n * [Conversion Specifier Quick Reference Table](#conversion-specifier-quick-reference-table)\n * [Parameter Selection](#parameter-selection)\n * [Dynamic Specifiers](#dynamic-specifiers)\n- [C Data Model](#c-data-model)\n + [Integer Types](#integer-types)\n + [Character and String Types](#character-and-string-types)\n + [Floating Point Number Types](#floating-point-number-types)\n * [Implementation](#implementation)\n- [Integer Conversions](#integer-conversions)\n * [Restricting Integer Values](#restricting-integer-values)\n * [Length Specifiers for Integer Conversions](#length-specifiers-for-integer-conversions)\n * [Rendering Unsigned Integers in Base 10 (\"u\" and \"U\" conversions)](#rendering-unsigned-integers-in-base-10-u-and-u-conversions)\n * [Rendering Unsigned Integers in Base 8 (\"o\" and \"O\" conversions)](#rendering-unsigned-integers-in-base-8-o-and-o-conversions)\n * [Rendering Unsigned Integers in Base 16 (\"x\" and \"X\" conversions)](#rendering-unsigned-integers-in-base-16-x-and-x-conversions)\n * [Rendering Signed Integers in Base 10 (\"d\" \"i\" and \"D\" conversions)](#rendering-signed-integers-in-base-10-d-i-and-d-conversions)\n- [Floating Point Conversions](#floating-point-conversions)\n * [Infinity, NaN, and Negative Zero](#infinity-nan-and-negative-zero)\n * [Exponential Form (\"e\" and \"E\" conversions)](#exponential-form-e-and-e-conversions)\n * [Standard Form (\"f\" and \"F\" conversions)](#standard-form-f-and-f-conversions)\n * [Value-dependent Form (\"g\" and \"G\" conversions)](#value-dependent-form-g-and-g-conversions)\n * [Hex-Mantissa Decimal-Binary-Exponent Form (\"a\" and \"A\" conversions)](#hex-mantissa-decimal-binary-exponent-form-a-and-a-conversions)\n- [Character Conversions](#character-conversions)\n * [Rendering Strings (\"s\" and \"S\" conversions)](#rendering-strings-s-and-s-conversions)\n * [Rendering Characters (\"c\" and \"C\" conversions)](#rendering-characters-c-and-c-conversions)\n- [Non-Numeric Conversions](#non-numeric-conversions)\n * [The literal \"%\" symbol (\"%\" conversion)](#the-literal-%25-symbol-%25-conversion)\n * [Interpreting and Rendering Pointers (\"p\" conversion)](#interpreting-and-rendering-pointers-p-conversion)\n * [Extracting length of a partial conversion (\"n\" conversion)](#extracting-length-of-a-partial-conversion-n-conversion)\n * [Error messages (\"m\" conversion)](#error-messages-m-conversion)\n- [Extensions](#extensions)\n * [Rendering Boolean Values (\"y\" and \"Y\" conversions)](#rendering-boolean-values-y-and-y-conversions)\n * [Rendering JSON (\"J\" conversion)](#rendering-json-j-conversion)\n * [JS typeof and valueOf (\"T\" and \"V\" conversion)](#js-typeof-and-valueof-t-and-v-conversion)\n * [Rendering Unsigned Integers in Base 2 (\"b\" and \"B\" conversions)](#rendering-unsigned-integers-in-base-2-b-and-b-conversions)\n- [Miscellaneous Notes](#miscellaneous-notes)\n * [Format Characters](#format-characters)\n * [JS and C strings](#js-and-c-strings-1)\n * [Browser Deviations](#browser-deviations)\n * [Support Summary](#support-summary)\n\n\n\n
\n\n## Installation\n\nWith [npm](https://www.npmjs.org/package/printj):\n\n```bash\n$ npm install printj\n```\n\nIn the browser:\n\n```html\n\n```\n\nThe browser exposes a variable `PRINTJ`\n\nWhen installed globally, npm installs a script `printj` that renders the format\nstring with the given arguments. Running the script with `-h` displays help.\n\nThe script will manipulate `module.exports` if available. This is not always\ndesirable. To prevent the behavior, define `DO_NOT_EXPORT_PRINTJ`\n\n### ES Module Support\n\nThe bundle ships with a `printj.mjs` script that acts as an ES Module.\n\n**NodeJS**\n\nNodeJS 12+ support ES modules. The default import uses the CommonJS script:\n\n```js\nimport PRINTJ from \"printj\";\n```\n\nIt is possible to use the ESM powered script referencing `printj.mjs` directly:\n\n```js\nimport * as PRINTJ from \"printj/printj.mjs\"; // pull all exports\nimport { sprintf } from \"printj/printj.mjs\"; // pull `sprintf`\n```\n\n**Browser Module Support**\n\nChrome 61+ and Safari 11+ support module imports in the web browser. The `.mjs`\nscript can be imported from a `script type=module` block:\n\n```html\n\n```\n\n\n## Usage\n\nIn all cases, the relevant function takes a format and arguments to be rendered.\n\nThe return value is a JS string.\n\n- `PRINTJ.sprintf(format, ...args)` assumes the arguments are passed directly\n\n- `PRINTJ.vsprintf(format, argv)` assumes the arguments are passed in an array\n\nFor example:\n\n```js\n> // var PRINTJ = require('printj'); // uncomment this line if in node\n> var sprintf = PRINTJ.sprintf, vsprintf = PRINTJ.vsprintf;\n> sprintf(\"Hello %s\", \"SheetJS\") // 'Hello SheetJS'\n> sprintf(\"%d + %d = %d\", 2,3,2+3) // '2 + 3 = 5'\n> vsprintf(\"%d + %d = %d\", [2,3,5]) // '2 + 3 = 5'\n> sprintf(\"%1$02hhx %1$u %1$i %1$o\", -69) // 'bb 4294967227 -69 37777777673'\n```\n\nThe command line script takes a format and arguments:\n\n```\nusage: printj [options] [args...]\n\nOptions:\n -h, --help output usage information\n -d, --dump print debug information about format string\n\nArguments are treated as strings unless prefaced by a type indicator:\n n: call parseInt (ex. n:3 -> 3)\n f: call parseFloat (ex. f:3.1 -> 3.1)\n b: false when lowercase value is \"FALSE\" or \"0\", else true\n s: interpret as string (ex. s:n:3 -> \"n:3\")\n j: interpret as an object using JSON.parse\n e: evaluate argument (ex. e:1+1 -> 2, e:\"1\"+1 -> \"11\")\n\nsamples:\n $ printj '|%02hhx%d|' n:50 e:0x7B # |32123|\n $ printj '|%2$d + %3$d is %1$d|' e:1+2 n:1 n:2 # |1 + 2 is 3|\n $ printj '|%s is %s|' s:1+2 e:1+2 # |1+2 is 3|\n $ printj '|%c %c|' s:69 n:69 # |6 E|\n```\n\n## Testing\n\n`make test` will run the nodejs-based test.\n\n`make stress` will run a larger test encompassing every possible conversion. It\nrequires access to a C compiler.\n\n## License\n\nPlease consult the attached LICENSE file for details. All rights not explicitly\ngranted by the Apache 2.0 license are reserved by the Original Author.\n\n## Badges\n\n[![Build Status](https://saucelabs.com/browser-matrix/printj.svg)](https://saucelabs.com/u/printj)\n\n[![Build Status](https://travis-ci.org/SheetJS/printj.svg?branch=master)](https://travis-ci.org/SheetJS/printj)\n\n[![Coverage Status](http://img.shields.io/coveralls/SheetJS/printj/master.svg)](https://coveralls.io/r/SheetJS/printj?branch=master)\n\n[![NPM Downloads](https://img.shields.io/npm/dt/printj.svg)](https://npmjs.org/package/printj)\n\n[![Dependencies Status](https://david-dm.org/sheetjs/printj/status.svg)](https://david-dm.org/sheetjs/printj)\n\n[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/printj?pixel)](https://github.com/SheetJS/printj)\n\n# printf format string specification\n\nThe `printf` family of functions attempt to generate and output a string of\ncharacters from a series of arguments, following a user-supplied \"format string\"\nspecification. The format string contains normal characters that are written to\nthe output string as well as specifiers that describe which parameter to insert\nand how to render the parameter. This specification describes how a conformant\nimplementation should process the format string and generate an output string.\nAny discrepancies between this document and the reference implementation are\nconsidered bugs in the implementation.\n\n### Original C Interface\n\nEvery function in the `printf` family follows the same logic to generate strings\nbut have different interfaces reflecting different input and output behaviors.\nSome functions have wide variants that use wide `wchar_t *` strings rather than\nnormal C `char *`. The following variants are required by the POSIX spec:\n\n| function | max length | output destination | vintage | wide form |\n|:-----------|:-----------|:----------------------|:--------|:-----------|\n| `printf` | unbounded | standard output | K&R | `wprintf` |\n| `fprintf` | unbounded | stream (`FILE *`) | K&R | `fwprintf` |\n| `sprintf` | unbounded | string (`char *`) | K&R | `swprintf` |\n| `snprintf` | parameter | string (`char *`) | C99 | |\n| `dprintf` | unbounded | POSIX file descriptor | POSIX | |\n\nEach function has a dual function, whose name begins with `v`, that accepts the\nparameters as a `va_list` rather than formal parameters. In all cases, they\nreturn the number of characters written or a negative value to indicate error:\n\n```C\nint sprintf(char *ostr, const char *fmt, ...);\nint vsprintf(char *ostr, const char *fmt, va_list arg_list);\n\nint swprintf(wchar_t *ostr, const wchar_t *fmt, ...);\nint vswprintf(wchar_t *ostr, const wchar_t *fmt, va_list arg_list);\n```\n\n### JS and C strings\n\nC \"strings\" are really just arrays of numbers. An external code page (such as\nASCII) maps those numbers to characters. K&R defines two types of strings:\nbasic character set strings (`char *`) and extended character set strings\n(`wchar_t *`). In contrast, JS has a true string value type.\n\nUnlike in C, JS strings do not treat the null character as an end-of-string\nmarker. As a result, characters beyond the first null character will be used.\n\nThe JS equivalent of a C extended string would be an array of the individual\ncharacter codes. The C basic string equivalent would involve specifying a code\npage and mapping back. The `codepage` JS library supports common codepages.\n\nWhile capturing the essence of C strings, using arrays of character codes is not\nidiomatic JS. Few developers leverage this and the downsides far exceed the\nbenefits of a more direct translation. The effect can be feigned, as shown in\nthe `js2c` code sample at the end of the document.\n\n### JS Interface\n\nIn the absence of a standard output or even a standard concept of a stream, the\nnon-string outputs are irrelevant. Similarly there is no JS analogue of wide\ncharacters. While useful, lack of direct memory management obviates `snprintf`.\nThis implementation exports the remaining functions, `sprintf` and `vsprintf`.\n\nInstead of replicating the original C signature and `errno`, functions directly\nreturn the output string and throw Errors:\n\n```typescript\nfunction sprintf(fmt:string, ...args):string;\nfunction vsprintf(fmt:string, args:Array):string;\n```\n\nThe C functions return the number of characters written to the string, which is\ndirectly accessible in JS via the `length` property. A direct replica of the\nvarious string functions are included at the end of the document.\n\n## Specifier heritage and regular expression\n\nNote: The regular expressions follow Perl `/x` style. Whitespace characters\noutside of character classes are ignored. `#` is a comment character and every\ncharacter until the end of the line is ignored. To convert to a standard regex:\n\n```js\nregex_string.replace(/#.*$/gm,\"\").replace(/^\\s*/gm,\"\").replace(/\\s*\\n/gm,\"\");\n```\n\nBased on K&R, conversions originally followed the format:\n\n - required: leading `%`\n - optional: `-` (POSIX refers to this as the \"flags\")\n - optional: positive number or `*` (POSIX \"width\")\n - optional: period followed by positive number or `*` (POSIX \"precision\")\n - optional: an `h` or `l` to indicate size of data (POSIX \"length\")\n - required: character describing output behavior (POSIX \"conversion specifier\")\n\nThis is captured by the regular expression:\n\n```perl\n/%(?:\n ([-])? # flags (only minus sign)\n (\\d+|\\*)? # width\n (?:\\.(\\d+|\\*))? # period + precision\n ([hl])? # length\n ([dioxXucsfeEgGp%]) # conversion specifier\n)/x\n```\n\nVarious implementations of `printf` have added different functionality.\n\nANSI standards up through C99:\n\n - more flags `\"+\"` `\" \"` `\"0\"` `\"#\"`\n - more lengths `\"L\"` `\"hh\"` `\"ll\"` `\"j\"` `\"z\"` `\"t\"`\n - more conversions `\"F\"` `\"a\"` `\"A\"` `\"n\"`\n\nThe POSIX specification of `printf` added:\n\n - positional parameters to identify argument indices\n - more flags `\"'\"`\n - more conversions `\"C\"` `\"S\"`\n - clarifications regarding corner cases and \"undefined behavior\"\n\nBSD implementations added:\n\n - more lengths `\"q\"`\n - more conversions `\"D\"` `\"U\"` `\"O\"`\n\nglibc (GNU) added:\n\n - more lengths `\"Z\"`\n - more conversions `\"m\"`\n\nWindows C Runtime (CRT) added:\n\n - more lengths `\"I\"` `\"I32\"` `\"I64\"` `\"w\"`\n\nglibc and CRT both added `Z`. glibc uses `Z` for the length `size_t`. CRT uses\n`Z` as a conversion for length-prefixed strings. This implementation takes the\nformer approach, handling `Z` in the same way as `z`.\n\nBSD and IBM C library both added `D`. BSD uses `D` as a conversion, namely as\nan alias of `ld`. IBM uses `D` for the length for `_Decimal64`, a decimal\nfloating point type, in accordance with ISO/IEC TR 24732. This implementation\ntakes the former approach.\n\nThis implementation also adds new conversions:\n\n - `\"b\"` and `\"B\"` for binary (base-2) integer renderings\n - `\"y\"` and `\"Y\"` for true/false and yes/no Boolean conversions\n - `\"J\"` for JSON\n - `\"T\"` and `\"V\"` for JS typeof and valueOf inspection\n\nCombining the various extensions yields the following regular expression:\n\n```perl\n/%(?:\n %| # literal %% (flags etc prohibited)\n ([1-9]\\d*\\$)? # positional parameter\n ([-+ 0\\x23\\x27]*)? # flags\n ([1-9]\\d*|\\*(?:[1-9]\\d*\\$)?)? # width\n (?:\\.(\\d+|\\*(?:[1-9]\\d*\\$)?))? # precision\n (hh?|ll?|[LzjtqZIw])? # length\n ([diouxXfFeEgGaAcCsSpnDUOmbByYJVT]) # conversion specifier\n)/x\n```\nThis implementation explicitly does not support certain non-standard extensions:\n\n - AltiVec vector length extensions (`v` with `h`/`l`/`ll`):\n - CRT fixed width lengths `I32` and `I64`\n\n## Conversion Specifier Quick Reference Table\n\n| C | Type | Summary |\n|-----|:--------:|-------------------------------------------------------------|\n| `a` | floating | base-2 exp form w/ hex mantissa and dec exponent, lowercase |\n| `A` | floating | base-2 exp form w/ hex mantissa and dec exponent, uppercase |\n| `b` | extended | cast to C `unsigned int`, standard form binary |\n| `B` | extended | cast to C `unsigned long`, standard form binary |\n| `c` | text | print `latin-1` char from number OR first char of string |\n| `C` | text | print `UCS-2` char from number OR first char of string |\n| `d` | integral | cast to C `int`, standard form decimal |\n| `D` | integral | cast to C `long`, standard form decimal |\n| `e` | floating | base-10 exp form w/dec mantissa and dec exponent, lowercase |\n| `E` | floating | base-10 exp form w/dec mantissa and dec exponent, uppercase |\n| `f` | floating | base-10 decimal form, lowercase extended values |\n| `F` | floating | base-10 decimal form, uppercase extended values |\n| `g` | floating | print using `e` or `f` conversion based on value/precision |\n| `G` | floating | print using `E` or `F` conversion based on value/precision |\n| `i` | integral | cast to C `int`, standard form decimal (alias of `d`) |\n| `J` | extended | prints objects using JSON or `util.inspect` |\n| `m` | misc | prints info about Error objects (JS equivalent of `errno`) |\n| `n` | misc | do not print! store number of chars written to `.len` field |\n| `o` | integral | cast to C `unsigned int`, standard form octal |\n| `O` | integral | cast to C `unsigned long`, standard form octal |\n| `p` | misc | print `\"l\"` field of object (fake pointer) |\n| `s` | text | print string argument |\n| `S` | text | print string argument (alias of `\"s\"`) |\n| `T` | extended | print type information (`typeof` or `Object toString`) |\n| `u` | integral | cast to C `unsigned int`, standard form decimal |\n| `U` | integral | cast to C `unsigned long`, standard form decimal |\n| `V` | extended | print primitive value (`valueOf`) |\n| `x` | integral | cast to C `unsigned int`, standard form hex, lowercase |\n| `X` | integral | cast to C `unsigned long`, standard form hex, uppercase |\n| `y` | extended | prints `true`/`false` or `yes`/`no` based on Boolean value |\n| `Y` | extended | prints `TRUE`/`FALSE` or `YES`/`NO` based on Boolean value |\n| `%` | misc | print the literal `%` character |\n\n## Parameter Selection\n\nThe default behavior is to consume arguments in order:\n\n```C\nprintf(\"Count to 3: %d %d %d\", 1, 2, 3); // Count to 3: 1 2 3\n```\n\nPOSIX `printf` permits explicit argument selection, bypassing the standard\nbehavior of consuming arguments in order. To specify the argument at position\n`n`, use `n$` immediately after the `%` token:\n\n```C\nprintf(\"%d %d %d\", 1, 2, 3); // 1 2 3 (implicit order 1, 2, 3 )\nprintf(\"%1$s %2$s %3$s\", \"a\", \"b\", \"c\"); // a b c (explicit order 1, 2, 3 )\nprintf(\"%1$s %3$s %2$s\", \"a\", \"b\", \"c\"); // a c b (explicit order 1, 3, 2 )\n```\n\nThe POSIX standard asserts that mixing positional and non-positional conversions\nis undefined behavior. This implementation handles mixing by tracking the index\nfor non-positional conversions:\n\n```C\nprintf(\"%s %4$s %s %5$s %s\", \"a\", \"b\", \"c\", \"d\", \"e\"); // a d b e c\n```\n\nThe POSIX standard requires that if an argument is used in the format, every\npreceding argument must be used. This implementation relaxes that requirement:\n\n```C\nprintf(\"%3$s\", \"a\", \"b\", \"c\"); // c (technically invalid since \"a\"/\"b\" unused)\n```\n\n## Dynamic Specifiers\n\nThe width and precision specifiers may include the dynamic specifier `*` which\ninstructs the engine to read the next argument (assumed to be an integer). Just\nas with the positional parameter, `idx$` immediately after the `*` token selects\nthe numeric argument.\n\nFor example:\n\n```C\nprintf(\"|%5s|\", \"sheetjs\"); // |sheetjs| (width = 5)\nprintf(\"|%*s|\", 5, \"sheetjs\"); // |sheetjs| (width first argument)\nprintf(\"|%2$*1$s|\", 5, \"sheetjs\", 10); // |sheetjs| (width is argument #1)\n\nprintf(\"|%10s|\", \"sheetjs\"); // | sheetjs| (width = 10)\nprintf(\"|%2$*3$s|\", 5, \"sheetjs\", 10); // | sheetjs| (width is argument #3)\n```\n\nArguments are generally consumed in order as presented in the format string:\n\n```C\nprintf(\"|%s|\", val);\nprintf(\"|%*s|\", width, val);\nprintf(\"|%.*s|\", prec, val);\nprintf(\"|%*.*s|\", width, prec, val);\nprintf(\"|%0*.*d|\", 4, 2, 1); // | 01| width=4 prec=2 value=1\n```\n\nPositional arguments can be applied to width and precision:\n\n```C\nprintf(\"|%*.*d|\", width, prec, val);\nprintf(\"|%2$0*3$.*1$d|\", prec, val, width);\nprintf(\"|%0*.*d|\", 4, 2, 1); // | 01| width=4 prec=2 value=1 flags='0'\nprintf(\"|%1$0*3$.*2$d|\", 1, 2, 4); // | 01| width=4 prec=2 value=1 flags='0'\n```\n\nA negative width is interpreted as the `-` flag with a positive width:\n\n```C\nprintf(\"|%*.*d|\", 4, 2, 1); // | 01| width=4 prec=2 value=1 flags=''\nprintf(\"|%-*.*d|\", 4, 2, 1); // |01 | width=4 prec=2 value=1 flags='-'\nprintf(\"|%*.*d|\", -4, 2, 1); // |01 | width=4 prec=2 value=1 flags='-'\nprintf(\"|%-*.*d|\", -4, 2, 1); // |01 | width=4 prec=2 value=1 flags='-'\n```\n\nA negative precision is discarded:\n\n```C\nprintf(\"|%*s|\", 4, \"sheetjs\"); // |sheetjs| width=4\nprintf(\"|%*.*s|\", 4, 3, \"sheetjs\"); // | she| width=4 prec=3\nprintf(\"|%*.*s|\", 4, 2, \"sheetjs\"); // | sh| width=4 prec=2\nprintf(\"|%*.*s|\", 4, 1, \"sheetjs\"); // | s| width=4 prec=1\nprintf(\"|%*.*s|\", 4, 0, \"sheetjs\"); // | | width=4 prec=0\nprintf(\"|%*.*s|\", 4, -1, \"sheetjs\"); // |sheetjs| width=4 (prec ignored)\n```\n\n\n# C Data Model\n\nJS has one numeric type `Number` which represents an IEEE754 double-precision\n(64-bit) floating point number. C has a multitude of numeric types, including\nfloating point as well as integer types. The sizes of those data types are\nimplementation-dependent. A \"C data model\" specifies the sizes of the core C\ndata types.\n\n### Integer Types\n\nPOSIX `printf` specification references 8 integer types in integer conversions:\n\n| C data type | fmt | unsigned type | fmt | signed type | fmt |\n|-------------|------:|----------------------|------:|---------------|------:|\n| `char` | | `unsigned char` | `hhu` | `signed char` | `hhd` |\n| `short` | `hd` | `unsigned short` | `hu` | | |\n| `int` | `d` | `unsigned int` | `u` | | |\n| `long` | `ld` | `unsigned long` | `lu` | | |\n| `long long` | `lld` | `unsigned long long` | `llu` | | |\n| `size_t` | `zu` | | | `ssize_t` | `zd` |\n| `intmax_t` | `jd` | `uintmax_t` | `ju` | | |\n| `ptrdiff_t` | `td` | | | | |\n\nC99 does not officially define a signed `size_t` or unsigned `ptrdiff_t` type.\nPOSIX does define `ssize_t` but no equivalent `uptrdiff_t`.\n\nBSD additionally recognizes the types `quad_t` and `u_quad_t`, which this\nimplementation treats as `long long int` and `unsigned long long int`.\n\n### Character and String Types\n\nTwo integer types are used in character and string conversions:\n\n| type | fmt |\n|-------------|------:|\n| `wchar_t` | `ls` |\n| `wint_t` | `lc` |\n\nBoth wide types `wchar_t` and `wint_t` can be signed or unsigned according to\nC99. Both types are used only in character and string conversions. Based on\nK&R \"printable characters are always positive\", the types are assumed unsigned.\n\n### Floating Point Number Types\n\nK&R recognizes 3 floating point types. C99 later tied it to IEC 60559:\n\n| C data type | precision | total bits | exponent | mantissa | fmt |\n|:--------------|:----------|:----------:|:--------:|:--------:|------:|\n| `float` | single | `32` | `8` | `23` | |\n| `double` | double | `64` | `11` | `52` | `f` |\n| `long double` | extended | `80` | `15` | `64` | `Lf` |\n\n## Implementation\n\nNumerous \"C data models\", specifying the bit/byte sizes of the various types,\nhave been and continue to be used. For example, OSX and other modern 64-bit\nUNIX flavors use the \"LP64\" C data model. 64-bit Windows currently uses the\n\"LLP64\" model. 32-bit systems generally use the \"ILP32\" model. The 8-bit byte\nsizes for the data types under the various models are defined in `ctypes.json`\nin the `Models` object as per the following table:\n\n| type | JSON key | LP64 | ILP32 | LLP64 |\n|:------------|:------------|-----:|------:|------:|\n| `char` | `char` | 1 | 1 | 1 |\n| `short` | `short` | 2 | 2 | 2 |\n| `int` | `int` | 4 | 4 | 4 |\n| `long` | `long` | 8 | 4 | 4 |\n| `long long` | `longlong` | 8 | 8 | 8 |\n| `wchar_t` | `wchar_t` | 4 | 4 | 2 |\n| `wint_t` | `wint_t` | 4 | 4 | 2 |\n| `size_t` | `size_t` | 8 | 4 | 8 |\n| `intmax_t` | `intmax_t` | 8 | 8 | 8 |\n| `ptrdiff_t` | `ptrdiff_t` | 8 | 4 | 8 |\n\nBy default the source assumes the LP64 data model. Other data models are\nsupported in the source tree, controlled by the JSFLAGS variable in the build\nprocess. Set the `JS_MODEL` variable to the desired index as specified in the\n`ModelNames` array in `bits/ctype.json`:\n\n```bash\n$ >>`, all\noperations act on signed integers. For example:\n\n```js\nMath.pow(2,31) | 0; // -2147483648 == -Math.pow(2,31)\n(Math.pow(2,32)-2) ^ 0; // -2\n-1 >>> 0 // 4294967295 == Math.pow(2,32) - 1\n```\n\nJS Number can exactly represent every integer in the range `-2^53 .. 2^53`. For\nlengths exceeding 32 bits, `Math.round` is appropriate.\n\n| bits | unsigned | signed |\n|------|---------------------------|-------------------------------------------|\n| 8 | `V & 0xFF` | `V &= 0xFF; if(V > 0x7F) V-= 0x100` |\n| 16 | `V & 0xFFFF` | `V &= 0xFFFF; if(V > 0x7FFF) V-= 0x10000` |\n| 32 | `V >>> 0` | `V \\| 0` |\n| 64 | `Math.abs(Math.round(V))` | `Math.round(V)` |\n\n## Length Specifiers for Integer Conversions\n\nWhen a length specifier implies a certain size (such as `hh` for a single-byte\ninteger), the number will be converted before rendering strings. For example:\n\n```C\nprintf(\"%1$02hhx %1$02hx %1$02lx %1$02llx\", 256); // |00 100 100 100|\nprintf(\"%1$02hhx %1$02hx %1$02lx %1$02llx\", 4096); // |00 1000 1000 1000|\nprintf(\"%1$02hhx %1$02hx %1$02lx %1$02llx\", 65536); // |00 00 10000 10000|\n```\n\nValues are restricted by first limiting the result to a specified number of\nbytes (appropriate bit-and) and then adding or subtracting to ensure the value\nis signed or unsigned according to the conversion specifier. If a length is\nspecified, it overrides the implied length of the conversion. The following\ntable describes the behavior of this implementation:\n\n| implied C type | JSON key | length | conversion default |\n|:-----------------------------|:------------|:--------:|:-------------------|\n| `[unsigned] int` | `int` | (none) | `d i o u x X` |\n| `[unsigned] char` | `char` | `hh` |\n| `[unsigned] short` | `short` | `h` |\n| `[unsigned] long` | `long` | `l` | `D U O` |\n| `[unsigned] long long` | `longlong` | `L ll q` |\n| `intmax_t` or `uintmax_t` | `intmax_t` | `j` |\n| `size_t` or `ssize_t` | `size_t` | `z Z` |\n| `ptrdiff_t` or unsigned form | `ptrdiff_t` | `t` |\n\n## Rendering Unsigned Integers in Base 10 (\"u\" and \"U\" conversions)\n\n`num.toString(10)` produces the correct result for exact integers.\n\n`\"u\"` conversion restricts values to `int`; `\"U\"` restricts to `long`.\n\n## Rendering Unsigned Integers in Base 8 (\"o\" and \"O\" conversions)\n\nEven though `num.toString(8)` is implementation-dependent, all browser\nimplementations use standard form for integers in the exact range.\n\nThe alternate form (`#`) prints a `\"0\"` prefix.\n\n`\"o\"` conversion restricts values to `int`; `\"O\"` restricts to `long`.\n\n## Rendering Unsigned Integers in Base 16 (\"x\" and \"X\" conversions)\n\nEven though `num.toString(16)` is implementation-dependent, all browser\nimplementations use standard form for integers in the exact range.\n\nThe alternate form (`#`) prints a `\"0x\"` or `\"0X\"` prefix.\n\nUnlike `\"U\" \"O\" \"D\"`, `\"X\"` conversion uses `A-F` instead of `a-f` in hex.\n\n## Rendering Signed Integers in Base 10 (\"d\" \"i\" and \"D\" conversions)\n\n`num.toString(10)` produces the correct result for exact integers. The flags\n`\" +\"` control prefixes for positive integers.\n\n`\"di\"` conversions restrict values to `int`; `\"D\"` restricts to `long`.\n\n\n# Floating Point Conversions\n\nThis section covers the conversions `fFeEgGaA`.\n\nDue to C variadic argument promotion rules, `float` types are always promoted to\n`double`. None of the conversions or length specifiers signal that an argument\nis to be interpreted as a `float`. There is no JS canonical representation of\nan extended floating point number, so JS `Number` suffices.\n\n## Infinity, NaN, and Negative Zero\n\nJS recognizes a few special IEEE754 values, as described in the following table:\n\n| JS value | JS Expression | Description |\n|------------:|:--------------|:-----------------------------------------------|\n| `Infinity` | `1./0.` | Positive limiting value `lim{x->0+} 1/x` |\n| `-Infinity` | `-1./0.` | Negative limiting value `lim{x->0+} -1/x` |\n| `NaN` | `0./0.` | Placeholder for \"not-a-number\" such as `0./0.` |\n| `-0.` | `-1/Infinity` | Negative limiting value `lim{x->0-} x` |\n\nJS `Number` methods render different strings from the POSIX spec:\n\n| JS value | POSIX string | JS string |\n|------------:|:----------------------------------------------|--------------:|\n| `Infinity` | `\"inf\" \"INF\"` or `\"infinity\" \"INFINITY\"` | `\"Infinity\"` |\n| `-Infinity` | `\"-inf\" \"-INF\"` or `\"-infinity\" \"-INFINITY\"` | `\"-Infinity\"` |\n| `NaN` | `\"[-]nan\" \"[-]NAN\"` w/opt parenthesized chars | `\"NaN\"` |\n| `-0.` | uses negative sign (`\"-0\"` under `\"%f\"`) | same as `+0.` |\n\nThis implementation performs the required adjustments.\n\n## Exponential Form (\"e\" and \"E\" conversions)\n\nAside from the special cases discussed above, JS `num.toExponential(prec)`\ndiffers from POSIX `printf(\"%1$.*2$e\", num, prec)` in the exponent field: JS\nwrites exponents with the fewest digits (POSIX requires 2+ digits). This is\naddressed by inspecting the output string and inserting a \"0\" when needed.\n\nThe optional `#` flag forces the decimal point to appear when precision is 0.\nThis is also fixed by adding a decimal point just before the \"e\".\n\n## Standard Form (\"f\" and \"F\" conversions)\n\nThe POSIX spec only requires that the number of digits after the decimal point\nis equal to the precision. It does not specify how many digits appear before\nthe decimal point, nor does it specify how to handle numbers that cannot be\nexactly represented.\n\nFor values less than `1e21` the JS `num.toFixed(n)` generally matches `%f` with\nthe specified precision. However, for larger values `toFixed` defaults to the\nexponential form.\n\n## Value-dependent Form (\"g\" and \"G\" conversions)\n\nThe final form (exponential or standard) is determined based on the value. The\nthreshold is different from the JS `toString` / `toPrecision` thresholds and\ndepends on the specified precision as well as the base-10 exponent:\n\n| Value | `\"%.3g\"` | `toPrecision(3)` |\n|------------:|:-----------|:-----------------|\n| `1.2345e-4` | `0.000123` | `0.000123` |\n| `1.2345e-5` | `1.23e-05` | `0.0000123` |\n| `1.2345e-6` | `1.23e-06` | `0.00000123` |\n| `1.2345e-7` | `1.23e-07` | `1.23e-7` |\n\nAccording to JS spec, `toPrecision` uses standard form when `precision > E` and\n`E >= -6`. For printf standard form is used when `precision > E` and `E >= -4`.\n\n## Hex-Mantissa Decimal-Binary-Exponent Form (\"a\" and \"A\" conversions)\n\nA general exponential form involves 3 parameters: radix of the mantissa, base of\nthe exponent expression, and radix of the exponent expression. The standard\nexponential form uses decimal for all three parts. For base 16, there are quite\na few reasonable combinations. Consider the value `1.234567e-80`:\n\n| Mantissa | Exp Base | Radix 10 (sigil `\";\"`) | Radix 16 (sigil `\";\"`) |\n|:--------:|:--------:|:-----------------------|:-----------------------|\n| 10 | 10 | `1.234567;-80` | `1.234567;-50` |\n| 16 | 10 | `1.3c0c9539b8887;-80` | `1.3c0c9539b8887;-50` |\n| 16 | 16 | `5.daf8c8f5f4104;-67` | `5.daf8c8f5f4104;-43` |\n| 16 | 4 | `1.76be323d7d041;-133` | `1.76be323d7d041;-85` |\n| 16 | 2 | `1.76be323d7d041;-266` | `1.76be323d7d041;-10a` |\n\nPOSIX `\"%a\"` uses a hex mantissa (16), decimal exponent radix (10), and binary\nexponent base (2). The general normalized form requires that the integral part\nof the mantissa to exceed 0 and not to exceed `exponent base - 1` except in the\nspecial case of `0`. The sigil is `p` and exponent sign is always used.\n\nJS `num.toString(radix)` is implementation-dependent for radices other than 10\n(`2-9, 11-36`). IE uses hex-mantissa decimal-hex-exponent form when the\nabsolute value of the base-2 exponent exceeds 60. Otherwise, IE uses an exact\nstandard hexadecimal form. Chrome, Safari and other browsers always use the\nexact standard hexadecimal form. Both forms are converted to `\"%a\"` by\ncalculating and dividing by the appropriate power of 2.\n\nFor each non-zero normal floating point value, there are 4 acceptable strings\nthat represent the value, derived by multiplying the normalized value by powers\nof 2 and adjusting the exponent accordingly:\n\n| Value | Normalized | Alternate `*2` | Alternate `*4` | Alternate `*8` |\n|:--------|:---------------|:---------------|:---------------|:---------------|\n| `1` | `1p+0` | `2p-1` | `4p-2` | `8p-3` |\n| `.2` | `1.9999999p-3` | `3.3333333p-4` | `6.6666666p-5` | `c.cccccccp-6` |\n| `.69` | `1.6147ae1p-1` | `2.c28f5c2p-2` | `5.851eb85p-3` | `b.0a3d70ap-4` |\n| `6.e20` | `1.043561p+69` | `2.086ac3p+68` | `4.10d586p+67` | `8.21ab0dp+66` |\n\nJS engines follow the glibc model: multiply by a suitable power of 16 so that\nthe mantissa is between 1 and 16, render left to right one digit at a time, then\nfix the result at the end. FreeBSD and OSX always show the normalized form.\nThis implementation defaults to the normalized form. To switch to the glibc\nform, define `DO_NOT_NORMALIZE` in the `JSFLAGS` variable when building:\n\n```bash\n$ JSFLAGS=-DDO_NOT_NORMALIZE make\n```\n\n# Character Conversions\n\nThis section covers the conversions `sScC`.\n\n## Rendering Strings (\"s\" and \"S\" conversions)\n\nJS has no concept of \"wide strings\" (`wchar_t *` in C), so the length modifiers\nare ignored. `s` and `S` are treated as equivalent.\n\nArguments are first interpreted as strings by calling the `String` function.\nImplementing `toString` on the argument to be converted may lead to unexpected\nresults:\n\n```C\nvar O = {valueOf:function() {return 456;}, toString:function() {return \"123\"}};\nprintf(\"%1$s %1$d\", O); // \"123 456\"\n```\n\nIf a positive precision is specified, up to that many characters will be taken\nfrom the string. Otherwise the entire string will be used:\n\n```C\nprintf(\"|%s|\", \"sheetjs\"); // '|sheetjs|' (no precision)\nprintf(\"|%.9s|\", \"sheetjs\"); // '|sheetjs|' (string shorter than precision)\nprintf(\"|%.5s|\", \"sheetjs\"); // '|sheet|' (string truncated)\n```\n\nLengths are measured using the JS string length accessor. Since there is no\nattempt to correct for multi-character sequences like combining marks, the\nresults may be unexpected:\n\n```C\nprintf(\"%.1s\",\"ñ\"); // 'n' not \"ñ\"\n```\n\nIf the width is specified and is greater than the width of the string to be\nrendered, padding will be applied. If the `\"-\"` flag is specified, then the\nstring will be right-padded, otherwise it will be left-padded. If the `\"0\"`\nflag is specified, the final string is left-padded with zeroes. The `\"-\"` flag\ntakes precedence over `0`.\n\n```C\nprintf( \"|%s|\", \"sheetjs\"); // '|sheetjs|' (no width)\nprintf( \"|%5s|\", \"sheetjs\"); // '|sheetjs|' (string longer than width)\nprintf( \"|%9s|\", \"sheetjs\"); // '| sheetjs|' (no flag = left pad spaces)\nprintf( \"|%09s|\", \"sheetjs\"); // '|00sheetjs|' (\"0\" = left pad \"0\")\nprintf( \"|%-9s|\", \"sheetjs\"); // '|sheetjs |' (\"-\" = right pad space)\nprintf(\"|%-09s|\", \"sheetjs\"); // '|sheetjs |' (\"0\" ignored)\n```\n\n## Rendering Characters (\"c\" and \"C\" conversions)\n\nJS has no concept of \"wide characters\" (`wchar_t` in C). The length modifier is\nused in determining whether the number should be interpreted as one or two\n16-bit character codes (when the \"C\" format or the \"l\" or \"ll\" specifiers are\nused) or a single 8-bit char code. Precision and flags are ignored.\n\n# Non-Numeric Conversions\n\n## The literal \"%\" symbol (\"%\" conversion)\n\nAll other parameters are ignored.\n\n## Interpreting and Rendering Pointers (\"p\" conversion)\n\nJS has no true concept of pointers. In array and typed array contexts, it is\ncommon to associate a position object that stores the address relative to the\nstart of the array. This implementation reads the `l` key and interprets as a\n32-bit or 52-bit unsigned integer depending on `size_t` in the data model.\n\nThe normal output format is equivalent to `\"%#x\"` but the alternate form emits\nusing the `\"%d\"` format. When the pointer is invalid, `-1` is rendered. Only\nthe `\"#\"` flag is interpreted.\n\n```js\nvar x = {}, y = {l:3};\nprintf(\"%1$p %1$#p\", y); // 0x3 3\nprintf(\"%1$p %1$#p\", x); // 0xFFFFFFFF -1\n```\n\n## Extracting length of a partial conversion (\"n\" conversion)\n\nC `printf` permits a special `n` conversion which interprets the argument as an\nintegral pointer (interpreted size controlled by the length specifier) and\nwrites the number of characters printed to that pointer.\n\nJS has no true concept of pointers in the C sense. The library works around\nthe limitation by interpreting the argument as an object and assigning to the\n`len` key. The conversion does not write any characters to the output string:\n\n```js\nvar x = {};\nprintf(\"%1$s %2$J%2$n abc\", \"foo\", x); // \"foo {} abc\", also sets x.len = 6\n// |........| |......| (6 chars at that point)\n```\n\nThis implementation mutates the object while processing:\n\n```js\nvar x = {};\nprintf(\"%1$s %2$J%2$n %3$s %2$J\", \"foo\", x, \"bar\"); // 'foo {} bar {\"len\":6}'\n```\n\n## Error messages (\"m\" conversion)\n\nglibc supports an `m` conversion that does not consume arguments. It renders\nthe string `strerror(errno)` where `strerror` is the libc function and `errno`\nis the global error number.\n\nJS has no equivalent of `errno` and no standard JS runtime exposes a similar\nglobal error variable, so `%m` will write the default message `\"Success\"`. A\npositional parameter or `#` flag changes the behavior:\n\n| form | position | behavior |\n|:------------:|:--------:|---------------------------------------|\n| main | no | do not read argument, emit \"Success\" |\n| alt (flag #) | no | read and process next argument |\n| main or alt | yes | read and process specified argument |\n\nIn all forms other than `\"%m\"`, an argument will be processed as follows:\n\n- If the argument is not an instance of an `Error`, emit \"Success\"\n- If the `message` field is set, emit the error message.\n- If the `errno` field is set, emit \"Error number \" followed by the errno\n- Otherwise emit \"Error \" followed by the error interpreted as a String\n\n```js\nvar x = new Error(\"sheetjs\");\nx.errno = 69; x.toString = function() { return \"SHEETJS\"; };\nprintf(\"|%#m|\", x); // |sheetjs|\ndelete x.message;\nprintf(\"|%#m|\", x); // |Error number 69|\ndelete x.errno;\nprintf(\"|%#m|\", x); // |Error SHEETJS|\n```\n\n# Extensions\n\nThese additional conversions take advantage of unused format characters:\n\n## Rendering Boolean Values (\"y\" and \"Y\" conversions)\n\nValues are converted to Boolean and tested for truthiness. The `Y` rendering\nis the uppercase version of the equivalent rendering with format `y`.\n\n\n| form | truthy value `y` (`Y`) | falsy value `y` (`Y`) |\n|:------------:|:-----------------------:|:---------------------:|\n| main | `true` (`TRUE`) | `false` (`FALSE`) |\n| alt (flag #) | `yes` (`YES`) | `no` (`NO`) |\n\nWidth and precision are applied in the same manner as the `s` conversion.\n\n```js\nprintf(\"|%1$y|%2$Y|%1$#Y|%2$#y|%2$.1y|\", 1, 0); // |true|FALSE|YES|no|f|\nprintf(\"|%05.2Y|%-5.2y|\", 1, 0); // |000TR|fa |\n```\n\n## Rendering JSON (\"J\" conversion)\n\nThe default rendering is the standard output from `JSON.stringify`. Alternate\nform (`\"#\"` flag) renders using `util.inspect` if available.\n\n```js\nvar x = {\n a: [1,[2,3,4],5,6,7],\n b: {\n c: {\n d: { e:\"f\" },\n g:\"h\",\n i:\"j\"\n },\n k:\"l\",\n m:\"n\",\n o:\"p\"},\n q: \"r\"\n};\nprintf(\"%J\", x) // '{\"a\":[1,[2,3,4],5,6,7],\"b\":{\"c\":{\"d\":{\"e\":\"f\"}, ..(ctnd)..\nprintf(\"%#J\", x) // '{ a: [ 1, [ 2, 3, 4 ], 5, 6, 7 ],\\n b: { c: { ..(ctnd)..\n```\n\nWidth, precision and other flags are ignored.\n\n## JS typeof and valueOf (\"T\" and \"V\" conversion)\n\nUnder the \"T\" conversion, the result of `typeof arg` is rendered. If the `#`\nflag is specified, the type is derived from `Object.prototype.toString`:\n\n```js\nprintf(\"%1$T %1$#T\", 1); // 'number Number'\nprintf(\"%1$T %1$#T\", 'foo'); // 'string String'\nprintf(\"%1$T %1$#T\", [1,2,3]); // 'object Array'\nprintf(\"%1$T %1$#T\", null); // 'object Null'\nprintf(\"%1$T %1$#T\", undefined); // 'undefined Undefined'\n```\n\nUnder the \"V\" conversion, the result of `arg.valueOf()` is rendered:\n\n```js\nvar _f = function() { return \"f\"; };\nvar _3 = function() { return 3; };\nprintf(\"%1$d %1$s %1$V\", {toString:_f}); // '0 f f'\nprintf(\"%1$d %1$s %1$V\", {valueOf:_3}); // '3 [object Object] 3'\nprintf(\"%1$d %1$s %1$V\", {valueOf:_3, toString:_f}); // '3 f 3'\n```\n\n## Rendering Unsigned Integers in Base 2 (\"b\" and \"B\" conversions)\n\nThe implementation is similar to the octal `\"o\"` and `\"O\"` conversions, except\nfor the radix (2 for `\"b\"` and `\"B\"`) and the alternate-form prefix (`\"0b\"`)\n\n# Miscellaneous Notes\n\n## Format Characters\n\nFor compatibility purposes, format characters must be printable ASCII characters\n(ASCII codes `0x20 - 0x7E`). The 95 eligible characters are listed below:\n\n| C | Type | C | Type | C | Type | C | Type |\n|-----|:----------:|-----|:----------:|-----|:----------:|-----|:----------:|\n| `a` | conversion | `A` | conversion | ` ` | flag | `!` | |\n| `b` | conversion | `B` | conversion | `\"` | | `#` | flag |\n| `c` | conversion | `C` | conversion | `$` | other | `%` | conversion |\n| `d` | conversion | `D` | conversion | `&` | | `'` | flag |\n| `e` | conversion | `E` | conversion | `(` | | `)` | |\n| `f` | conversion | `F` | conversion | `*` | other | `+` | flag |\n| `g` | conversion | `G` | conversion | `,` | | `-` | flag |\n| `h` | length | `H` | | `.` | other | `/` | |\n| `i` | conversion | `I` | length | `0` | digit | `1` | digit |\n| `j` | length | `J` | conversion | `2` | digit | `3` | digit |\n| `k` | | `K` | | `4` | digit | `5` | digit |\n| `l` | length | `L` | length | `6` | digit | `7` | digit |\n| `m` | conversion | `M` | | `8` | digit | `9` | digit |\n| `n` | conversion | `N` | | `:` | | `;` | |\n| `o` | conversion | `O` | conversion | `<` | | `=` | |\n| `p` | conversion | `P` | | `>` | | `?` | |\n| `q` | length | `Q` | | `@` | | `[` | |\n| `r` | | `R` | | `\\` | | `]` | |\n| `s` | conversion | `S` | conversion | `^` | | `_` | |\n| `t` | length | `T` | conversion | `~` | | `{` | |\n| `u` | conversion | `U` | conversion | `|` | | `}` | |\n| `v` | | `V` | conversion | `` ` `` | |\n| `w` | length | `W` | |\n| `x` | conversion | `X` | conversion |\n| `y` | conversion | `Y` | conversion |\n| `z` | length | `Z` | length |\n\n## JS and C strings\n\nC provides no guidance on the actual character set. According to K&R all valid\ncharacters in source code must be in a character set that is a subset of the\n7-bit ASCII set. This implementation falls back on the UTF-16 base required by\nJS. When converting C literal strings, there are a few differences in escaping:\n\n| C escape sequence | Equivalent JS | Notes |\n|:------------------|:--------------|:---------------------------------------|\n| `\"\\a\"` | `\"\\007\"` | BEL character will not ring in browser |\n| `\"\\?\"` | `\"?\"` | JS does not handle trigraphs |\n| `\"\\ooo\"` (octal) | `\"\\ooo\"` | JS uses Latin-1 for non-ASCII codes |\n| `\"\\xhh\"` (hex) | `\"\\xhh\"` | JS uses Latin-1 for non-ASCII codes |\n\n## Browser Deviations\n\nOpera does not always include the last significant digit in base 16 rendering.\nFor example, `(-6.9e-11).toString(16)` is `\"0.000000004bddc5fd160168\"` in every\nother browser but is `\"0.000000004bddc5fd16017\"` in Opera. The test suite skips\nthe `%a/%A` precision-less formats in Opera.\n\n`Object.prototype.toString.call` gives unexpected results in older browsers, and\nno attempt is made to correct for them. The test suite ignores those cases:\n\n| value | `%#T` expected | `%#T` IE < 9 | `%#T` Android < 4.4 |\n|:------------|:---------------|:-------------|:--------------------|\n| `null` | `\"Null\"` | `\"Object\"` | `\"global\"` |\n| `undefined` | `\"Undefined\"` | `\"Object\"` | `\"global\"` |\n\n## Support Summary\n\n- Full [POSIX](http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html) conversion support with extensions!\n [Conversion Specifier Table](#conversion-specifier-quick-reference-table)\n- Full support for POSIX flags and positional parameters\n- Emulation of BSD `quad_t` and `u_quad_t` conversion\n- Parser accepts but does not emulate CRT wide and unicode character conversions\n- glibc `Z` length conversion and extended `m` error support\n- Parser fails on CRT `I32`/`I64` fixed lengths\n- Default `LP64` data model but can be configured to support `ILP32` or `LLP64`\n\n","maintainers":[{"name":"sheetjs","email":"dev@sheetjs.com"}],"time":{"modified":"2022-06-24T16:08:45.162Z","created":"2016-09-19T06:41:09.568Z","0.1.0":"2016-09-19T06:41:09.568Z","0.1.1":"2016-10-08T17:35:54.888Z","1.0.0":"2017-01-05T02:48:06.347Z","1.0.1":"2017-07-04T06:58:56.116Z","1.0.2":"2017-07-04T07:50:02.973Z","1.1.0":"2017-07-23T19:46:33.320Z","1.1.1":"2018-01-17T02:40:25.088Z","1.1.2":"2018-02-20T23:25:30.073Z","1.2.0":"2018-09-04T05:23:03.877Z","1.2.1":"2018-10-19T17:15:52.574Z","1.2.2":"2019-07-29T11:02:30.243Z","1.2.3":"2021-08-30T02:32:58.533Z","1.3.0":"2021-08-30T21:48:18.204Z","1.3.1":"2022-01-24T05:03:02.776Z"},"keywords":["printf","sprintf","format","string"],"repository":{"type":"git","url":"git://github.com/SheetJS/printj.git"},"author":{"name":"sheetjs"},"bugs":{"url":"https://github.com/SheetJS/printj/issues"},"license":"Apache-2.0","readmeFilename":"README.md","homepage":"https://sheetjs.com/","users":{"sheetjsdev":true}}