node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

format-io

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

size

    var size    = 1024 * 1024 * 5,
        sizeStr = Format.size(size);
        //'5.00mb' 

permissions.symbolic

    var perm    = '00777',
        permStr = Format.permissions.symbolic(perm);
        //'rwx rwx rwx 

permissions.numeric

    var perm    = 'rwx rwx rwx',
        permNum = Format.permissions.numeric(perm);
        //'00777' 

License

MIT