format-io

Format size, permissions, etc

Format

Library for format size, permissions, etc.

How to use?

Format could be used in browser or node.

In browser:

<script src='lib/format.js'></script>

In node:

var Format = require('format-io');

API

    var size    = 1024 * 1024 * 5,
        sizeStr = Format.size(size);
        //'5.00mb' 
    var perm    = '00777',
        permStr = Format.permissions.symbolic(perm);
        //'rwx rwx rwx 
    var perm    = 'rwx rwx rwx',
        permNum = Format.permissions.numeric(perm);
        //'00777' 

License

MIT