Skip to content
format directory content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.eslintrc
.eslintrc.test
.gitignore
.npmignore
.travis.yml
ChangeLog
LICENSE
README.md
package.json

README.md

Formatify License NPM version Dependency Status Build Status Coverage Status

Format directory content received by readify.

Install

npm i @cloudcmd/formatify --save

API

formatify(files)

  • files - files list

Examples

const files = [{
    name: 'sortify.js',
    size: 3538,
    date,
    owner: 0,
    mode: 33204,
}, {
    name: 'readify.js',
    size: 1629,
    date: 2016-11-21T13:37:55.275Z,
    owner: 0,
    mode: 33204,
}];

formatify(files)
// returns
[{
    name: 'formatify.js',
    size: '3.46kb',
    date: '12.01.2017',
    owner: 0,
    mode: 'rw- rw- r--',
}, {
    name: 'readify.js',
    size: '1.59kb',
    date: '12.01.2017',
    owner: 0,
    mode: 'rw- rw- r--',
}];

Related

  • Sortify - sort directory content by name, size, date
  • Readify - read directory content with file attributes: size, date, owner, mode

License

MIT

You can’t perform that action at this time.