nunjucks-filesizeformatfilter
v1.0.3
Published
Format values to user friendly values
Downloads
3
Maintainers
Readme
Nunjucks filter filesizeformatfilter
Nunjucks filter Formats to user friendly file sizes such as 1.8MB or 1.2TB
Install
$ npm install --save nunjucks-filesizeformatfilter
Usage
Install as custom filter:
var nunjucks = require('nunjucks');
var filesize = require('nunjucks-filesizeformatfilter');
var env = new nunjucks.Environment();
env.addFilter('filesizeformat', filesize);
Use in template:
{{ 1230456|filesize }}
Outputs 1.2 MB
Support
Same support as Nunjucks:
- Node >= v0.10
License
Originally developed by jbmoelker