JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9636
  • Score
    100M100P100Q126415F
  • License MIT

Format size, permissions, etc

Package Exports

  • format-io

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (format-io) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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