filesize-parser

Takes human readable filesystem size strings and gives you an int representing that many bytes.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
filesize-parser
2501.5.06 years ago11 years agoMinified + gzip package size for filesize-parser in KB

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