GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arvidkahl/sizeable: An Elixir library to make File Sizes human-readable

BranchesTags
Open more actions menu

Latest commit

 

History

34 Commits
34 Commits

Folders and files

NameName
Last commit message
Last commit date
config
config
 
 
docs
docs
 
 
lib
lib
 
 
test
test
 
 
.formatter.exs
.formatter.exs
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
mix.exs
mix.exs
 
 
mix.lock
mix.lock
 
 

Repository files navigation

Sizeable

Module Version Hex Docs Total Download License Last Updated

An Elixir library to make file sizes human-readable.

Installation

The package can be installed as:

  1. Add :sizeable to your list of dependencies in mix.exs:

    def deps do
      [
        {:sizeable, "~> 1.0"}
      ]
    end
  2. Ensure sizeable is started before your application if you're using Elixir 1.3 or lower:

    def application do
      [
        applications: [:sizeable]
      ]
    end

Usage

Get file size for 1024 bytes

Sizeable.filesize(1024)
"1 KB"

Get bit-sized file size for 1024 bytes

Sizeable.filesize(1024, bits: true)
"8 Kb"

Get output format as list

Sizeable.filesize(1024, output: :list)
[1, "KB"]

Get output format as map

Sizeable.filesize(1024, output: :map)
%{result: 1, unit: "KB"}

Read Sizeable.filesize/2 for further usage details.

Copyright and License

Copyright (c) 2016 Arvid Kahl

This software is licensed under the MIT license.

About

An Elixir library to make File Sizes human-readable

Resources

Readme
MIT license
Activity

Stars

42 stars

Watchers

3 watching

Forks

9 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.