{"_id":"si","_rev":"11-00f991c1b57c5118bc9e9abaa340dec7","name":"si","description":"SI and IEC compatible large number parser/formatter module for node.js","dist-tags":{"latest":"2.0.0"},"versions":{"0.2.0":{"name":"si","version":"0.2.0","description":"SI and IEC compatible large number parser/formatter module for node.js","author":{"name":"Michal Czapracki"},"contributors":[],"homepage":"https://github.com/MichalCz/node-si","licenses":[{"type":"MIT","url":"https://github.com/MichalCz/node-si/blob/master/LICENSE"}],"keywords":["kilo","mega","giga","tera","peta","exa","IEC","SI","human readable","large numbers"],"engines":{"node":">= 0.2.0"},"bugs":{"url":"http://github.com/MichalCz/node-si/issues"},"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git://github.com/MichalCz/node-si.git"},"main":"./main.js","readme":"Node Si\n=========\n\nThe goal of this project is to provide a simple module that parses and formats\nnumbers to be human readable - like \"10gb\" -> 1e10.\n\nThis might be especially useful in command line arguments and configuration \ndirectives where you don't want the user to pass the whole number or use the \nscientific notation.\n\nUsage\n-------\n\nWrite a simple code, like:\n\n    var si = require('si'),\n        number = si.parse(process.argv[2]);\n        \n    console.log('Your number is: ', \n                    number);\n    console.log('The square of it is: ', \n                    si.format(Math.pow(number, 2)));\n    console.log('The square root on the other hand is: ', \n                    si.format(Math.pow(number, 0.5)));\n\nNow run it:\n\n    $ node tests/basic.js 1G\n    Your number is:  1000000000\n    The square of it is:  1E\n    The square root on the other hand is:  31.62k\n\nFairly straightforward I hope.\n\nFuture\n--------\n\nI will be bringing some more parsers/formatters in later releases, like:\n\n* IEC compliant binary multipliers like \"MiB\"\n* Case sensitive Mbytes/mbytes (decimal vs. binary)\n* Fractional SI multipliers like centi/mili etc.\n\nFeel free to post feature requests in issues. :)\n\nLicense\n=========\n\n(The MIT License)\n\nCopyright (c) 2012 Michał Czapracki budleigh.salterton@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"si@0.2.0","dist":{"shasum":"f4fb61becd1ca980d10b9dbfe3736edf420cc225","tarball":"https://registry.npmjs.org/si/-/si-0.2.0.tgz","integrity":"sha512-TWHSxFNKP3gTljmCYQQd9NarAFeS5rplEsSh8bA8eXrJK4eB5phBVchOHbHhurd7KJ4n2jDWm74kaKzw2v85uQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmFIhdyjmZXcarSMfS4D+EdgW0pPyTWy58SUHoYtMJrQIgDiG2F8y8Cd1FT90x60T5t951KlGxDcHuCHmuHh02jfY="}]},"scripts":{},"_npmVersion":"1.1.59","_npmUser":{"name":"michalcz","email":"budleigh.salterton@gmail.com"},"maintainers":[{"name":"michalcz","email":"budleigh.salterton@gmail.com"}]},"1.0.0":{"name":"si","version":"1.0.0","description":"SI and IEC compatible large number parser/formatter module for node.js","author":{"name":"Michal Czapracki"},"contributors":[],"homepage":"https://github.com/MichalCz/node-si","licenses":[{"type":"MIT","url":"https://github.com/MichalCz/node-si/blob/master/LICENSE"}],"keywords":["kilo","mega","giga","tera","peta","exa","IEC","SI","human readable","large numbers"],"engines":{"node":">= 0.2.0"},"bugs":{"url":"http://github.com/MichalCz/node-si/issues"},"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git://github.com/MichalCz/node-si.git"},"main":"./main.js","readme":"Node Si\r\n=========\r\n\r\nThe goal of this project is to provide a simple module that parses and formats\r\nnumbers to be human readable - like \"10gb\" -> 1e10.\r\n\r\nThis might be especially useful in command line arguments and configuration \r\ndirectives where you don't want the user to pass the whole number or use the \r\nscientific notation.\r\n\r\nUsage\r\n-------\r\n\r\nWrite a simple code, like:\r\n\r\n    var si = require('si'),\r\n        number = si.parse(process.argv[2]);\r\n        \r\n    console.log('Your number is: ', \r\n                    number);\r\n    console.log('The square of it is: ', \r\n                    si.format(Math.pow(number, 2)));\r\n    console.log('The square root on the other hand is: ', \r\n                    si.format(Math.pow(number, 0.5)));\r\n\r\nNow run it:\r\n\r\n    $ node tests/basic.js 1G\r\n    Your number is:  1000000000\r\n    The square of it is:  1E\r\n    The square root on the other hand is:  31.62k\r\n\r\nFairly straightforward I hope.\r\n\r\nBinary vs. decimal prefixes\r\n-----------------------------\r\n\r\nYou may use either decimal or binary prefixing:\r\n\r\n\tvar si = require('si'), \r\n\t\tbinNum = 8 << 20,\r\n\t\tdecNum = 8e6;\r\n\t\t\r\n\tconsole.log(si.si.format(binNum) + 'bytes vs. ' + si.bin.format(binNum) + 'bytes'); \r\n\t// will output: 8.338Mbytes vs. 8Mbytes\r\n\r\n\tconsole.log(si.si.format(decNum) + 'bytes vs. ' + si.bin.format(decNum) + 'bytes'); \r\n\t// will output: 8Mbytes vs. 7.629Mbytes\r\n\r\nThis might be quite handy for reading command line numbers like bitrate or byte offsets in files.\r\n\r\nFuture\r\n--------\r\n\r\nI will be bringing some more parsers/formatters in later releases, like:\r\n\r\n* IEC compliant binary multipliers like \"MiB\"\r\n* Case sensitive Mbytes/mbytes (decimal vs. binary)\r\n* Fractional SI multipliers like centi/mili etc.\r\n\r\nFeel free to post feature requests in issues. :)\r\n\r\nLicense\r\n=========\r\n\r\n(The MIT License)\r\n\r\nCopyright (c) 2012 Michał Czapracki budleigh.salterton@gmail.com\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"si@1.0.0","dist":{"shasum":"bfdf28ffaf6a661e5b74365326588d350796455e","tarball":"https://registry.npmjs.org/si/-/si-1.0.0.tgz","integrity":"sha512-L8Ok+2d9znwfyd/eiVXFiD+fxIiKyIvyQCSeZWkTZB3EjAOJPEyJBrJxTKhONEzu8Msi3hxDWZAgHxdYpV7j+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTGkeuD4KbzmaR6nQNZyxwGjfTenVCAfGonGMWPn+dNAiEAlgXUWJUfM8S4dvOkTcaQDbbG8k9tIlYqjqYWyogBNik="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"michalcz","email":"budleigh.salteron@gmail.com"},"maintainers":[{"name":"michalcz","email":"budleigh.salterton@gmail.com"}]},"2.0.0":{"name":"si","version":"2.0.0","description":"SI and IEC compatible large number parser/formatter module for node.js","author":{"name":"Michal Czapracki"},"contributors":[],"homepage":"https://github.com/MichalCz/node-si","licenses":[{"type":"MIT","url":"https://github.com/MichalCz/node-si/blob/master/LICENSE"}],"keywords":["time","days","cron","interval","hours","minutes","kilo","mega","giga","tera","peta","exa","IEC","SI","human readable","large numbers"],"engines":{"node":">= 0.2.0"},"bugs":{"url":"http://github.com/MichalCz/node-si/issues"},"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git://github.com/MichalCz/node-si.git"},"main":"./main.js","readme":"Node Si\n=========\n\nThe goal of this project is to provide a simple module that parses and formats\nnumbers to be human readable - like:\n* \"10gb\" -> 1e10 \n* \"4 days 7:30:01.444\" -> 372601.444\n* \"64Kb\" -> 65536\n\nThis might be especially useful in command line arguments and configuration \ndirectives where you don't want the user to pass the whole number or use the \nscientific notation.\n\nUsage\n-------\n\nWrite a simple code, like:\n\n    var si = require('si'),\n        number = si.parse(process.argv[2]);\n        \n    console.log('Your number is: ', \n                    number);\n    console.log('The square of it is: ', \n                    si.format(Math.pow(number, 2)));\n    console.log('The square root on the other hand is: ', \n                    si.format(Math.pow(number, 0.5)));\n\nNow run it:\n\n    $ node tests/basic.js 1G\n    Your number is:  1000000000\n    The square of it is:  1E\n    The square root on the other hand is:  31.62k\n\nFairly straightforward I hope.\n\nTime intervals\n----------------\n\nAs of version 2.0.0 you can use node-si to read time intervals. In 2.0.0 only\n\"n days hh:mm:dd\" format is recognized.\n\nTo read it, use something like this:\n\n    var hms = require('si').hms, \n        time = si.parse(process.argv.slice(2).join(' '));\n\n    console.log('This program will self destruct in ' + hms.format(time));\n    setTimeout(function() { console.log('thanks for waiting...'); }, time);\n\nShould you want to format the time on the other hand:\n\n    var hms = require('si').hms,\n        time = +process.argv[2];\n\n    console.log('This program will self destruct in ' + hms.format(time));\n    setTimeout(function() { console.log('thanks for waiting...'); }, time);\n\nMore implementations will follow (see \"Future\").\n\nBinary vs. decimal prefixes\n-----------------------------\n\nYou may use either decimal or binary prefixing:\n\n\tvar si = require('si'), \n\t\tbinNum = 8 << 20,\n\t\tdecNum = 8e6;\n\t\t\n\tconsole.log(si.si.format(binNum) + 'bytes vs. ' + si.bin.format(binNum) + 'bytes'); \n\t// will output: 8.338Mbytes vs. 8Mbytes\n\n\tconsole.log(si.si.format(decNum) + 'bytes vs. ' + si.bin.format(decNum) + 'bytes'); \n\t// will output: 8Mbytes vs. 7.629Mbytes\n\nThis might be quite handy for reading command line numbers like bitrate or byte offsets in files.\n\nFuture\n--------\n\nI will be bringing some more parsers/formatters in later releases, like:\n\nNumbers:\n* IEC compliant binary multipliers like \"MiB\"\n* Case sensitive Mbytes/mbytes (decimal vs. binary)\n* Fractional SI multipliers like centi/mili etc.\n\nTime:\n* ISO 8601 time intervals (P1Y2M10DT2H30M/2008-05-11T15:30:00Z)\n* Reading days and months\n\nFeel free to post feature requests in issues. :)\n\nLicense\n=========\n\n(The MIT License)\n\nCopyright (c) 2012 Michał Czapracki budleigh.salterton@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","_id":"si@2.0.0","dist":{"shasum":"0109ec661effd629fc295f4c1978ebc339e83d45","tarball":"https://registry.npmjs.org/si/-/si-2.0.0.tgz","integrity":"sha512-snXUjrT661viwoHfFESmLtt8qND1eR66T5OA18P/85ltkH06EiihT0f0QVDDzzoQnZdmgTPf9Fddiz8sB0YUyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7HwF8Evzu3rbn4rsKZv/YKOFiDNuPtv9Z1LZcXOM1cgIhAK6tuEM3dCjGIeqkfqKXPwcE1DP3bYT+jFamdDy+Okp5"}]},"_from":"https://github.com/MichalCz/node-si/archive/2.0.0.tar.gz","_resolved":"https://github.com/MichalCz/node-si/archive/2.0.0.tar.gz","scripts":{},"_npmVersion":"1.3.8","_npmUser":{"name":"michalcz","email":"budleigh.salterton@gmail.com"},"maintainers":[{"name":"michalcz","email":"budleigh.salterton@gmail.com"}]}},"readme":"Node Si\n=========\n\nThe goal of this project is to provide a simple module that parses and formats\nnumbers to be human readable - like \"10gb\" -> 1e10.\n\nThis might be especially useful in command line arguments and configuration \ndirectives where you don't want the user to pass the whole number or use the \nscientific notation.\n\nUsage\n-------\n\nWrite a simple code, like:\n\n    var si = require('si'),\n        number = si.parse(process.argv[2]);\n        \n    console.log('Your number is: ', \n                    number);\n    console.log('The square of it is: ', \n                    si.format(Math.pow(number, 2)));\n    console.log('The square root on the other hand is: ', \n                    si.format(Math.pow(number, 0.5)));\n\nNow run it:\n\n    $ node tests/basic.js 1G\n    Your number is:  1000000000\n    The square of it is:  1E\n    The square root on the other hand is:  31.62k\n\nFairly straightforward I hope.\n\nFuture\n--------\n\nI will be bringing some more parsers/formatters in later releases, like:\n\n* IEC compliant binary multipliers like \"MiB\"\n* Case sensitive Mbytes/mbytes (decimal vs. binary)\n* Fractional SI multipliers like centi/mili etc.\n\nFeel free to post feature requests in issues. :)\n\nLicense\n=========\n\n(The MIT License)\n\nCopyright (c) 2012 Michał Czapracki budleigh.salterton@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","maintainers":[{"name":"michalcz","email":"budleigh.salterton@gmail.com"}],"time":{"modified":"2022-06-26T19:13:56.662Z","created":"2012-08-30T21:41:43.594Z","0.2.0":"2012-08-30T21:41:45.555Z","1.0.0":"2013-02-15T00:25:54.801Z","2.0.0":"2013-10-27T21:44:06.851Z"},"author":{"name":"Michal Czapracki"},"repository":{"type":"git","url":"git://github.com/MichalCz/node-si.git"},"users":{"eins78":true,"michalcz":true}}