Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

filesize-parser

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filesize-parser

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

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
decreased by-61.84%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 10 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc