Skip to content

patrickkettner/filesize-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

convert human readable filesizes to their byte equivalent

Resources

Stars

Watchers

Forks

Packages

No packages published