{"name":"quick-format","version":"2.0.6","description":"Solves a problem with util.format","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test"},"author":{"name":"David Mark Clements"},"devDependencies":{"fastbench":"^1.0.1"},"dependencies":{"fast-safe-stringify":"^1.0.8"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/quick-format.git"},"keywords":[],"license":"MIT","bugs":{"url":"https://github.com/davidmarkclements/quick-format/issues"},"homepage":"https://github.com/davidmarkclements/quick-format#readme","gitHead":"58626f95dba57928e24086dcd3ab460e66bd8c80","_id":"quick-format@2.0.6","_shasum":"1611f74cbd2ebc19e4b4c653f7ef7f55c4928572","_from":".","_npmVersion":"2.14.17","_nodeVersion":"6.7.0","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"shasum":"1611f74cbd2ebc19e4b4c653f7ef7f55c4928572","tarball":"http://registry-npm.ywwl.com/quick-format/download/quick-format-2.0.6.tgz","integrity":"sha512-5FPqdgMrxGM9CmcITCP+r4REl6iU87qW9RvyL5pco/E9BvK40j257XqwDcezpHmEhBgjsH909noyhvC8yYFU8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA6bI79/oTsIqUz3JA1QFYN3pQ0UXaUvzwwqxBpj2tueAiEApy0+KYYKn1QfDwrhwIwn+RMx5dLftLzhImM0doygkgQ="}],"size":3332,"noattachment":false,"key":"/quick-format/-/quick-format-2.0.6.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/quick-format-2.0.6.tgz_1476462362959_0.35567505611106753"},"readme":"# quick format\n\nSolves a problem with util.format\n\n## usage\n\n```js\nvar format = require('quick-format')\nvar options = {lowres: false} // <--default\nformat(['hello %s %j %d', 'world', {obj: true}, 4, {another: 'obj'}], options)\n```\n\n## options\n\n### lowres\n\nPassing an options object with `lowres: true` will cause quick-format any object with a circular as a string with the value '\"[Circular]\"'. The default behaviour is to label\ncircular references in an object, instead of abandoning the entire object. Naturally, \n`lowres` is a faster mode, and assumes you have made the decision to ensure the objects\nyou're passing have no circular references.\n\n## caveats\n\nWe use `JSON.stringify` instead of `util.inspect`, this means object\nmethods (functions) *will not be serialized*.\n\n##  util.format\n\nIn `util.format` for Node 5.9, performance is significantly affected\nwhen we pass in more arguments than interpolation characters, e.g\n\n```js\nutil.format('hello %s %j %d', 'world', {obj: true}, 4, {another: 'obj'})\n```\n\nThis is mostly due to the use of `util.inspect`. Use `JSON.stringify`\n(safely) instead which is significantly faster. \n\nIt also takes an array instead of arguments, which helps us \navoid the use of `apply` in some cases.\n\nAlso - for speed purposes, we ignore symbol.\n\n## Benchmarks\n\nWhilst exact matching of objects to interpolation characters is slower,\nthe case of additional objects is 3x faster. Further, using `lowres` mode\nbrings us closer to `util.inspect` speeds.\n\n```\nutil*100000: 205.978ms\nquickLowres*100000: 236.337ms\nquick*100000: 292.018ms\nutilWithTailObj*100000: 1054.592ms\nquickWithTailObjLowres*100000: 267.992ms\nquickWithTailObj*100000: 343.048ms\nutil*100000: 212.011ms\nquickLowres*100000: 226.441ms\nquick*100000: 296.600ms\nutilWithTailObj*100000: 1020.195ms\nquickWithTailObjLowres*100000: 267.331ms\nquickWithTailObj*100000: 343.867ms\n```\n\n## Acknowledgements\n\nSponsored by nearForm\n","publish_time":1476462364125,"_cnpm_publish_time":1476462364125,"dist-tags":{"latest":"2.1.0"}}