filesize-parser
v1.5.1
Published
Takes human readable filesystem size strings and gives you an int representing that many bytes.
Downloads
43,575
Readme
filesize-parser
Super simple module to take a human readable file size string and give you the byte representation of it.
var filesizeParser = require('filesize-parser');
filesizeParser('200kb')
204800
filesizeParser('200KB')
204800
filesizeParser('200Kb')
25600
The default base is 2
, you can use base 10
var filesizeParser = require('filesize-parser');
filesizeParser('200kb', {base: 10})
200000
filesizeParser('200KB', {base: 10})
200000
filesizeParser('200Kb', {base: 10})
25000