+9
-2
@@ -1,2 +0,4 @@ | ||
| var _ = require('lodash'); | ||
| (function(){ | ||
| var isSSJS = 'undefined' !== typeof module && module.exports; | ||
| var _ = isSSJS ? require('lodash') : _; | ||
@@ -110,2 +112,7 @@ function Humanize(baseUnitName, baseUnit){ | ||
| module.exports = Humanize; | ||
| if (isSSJS) { | ||
| module.exports = Humanize; | ||
| } else { | ||
| this.Humanize = Humanize; | ||
| } | ||
| }()); |
+6
-3
| { | ||
| "name": "humanizer", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "description": "Humanize a value.", | ||
@@ -11,7 +11,10 @@ "main": "humanize.js", | ||
| "type": "git", | ||
| "url": "git://github.com/FGRibreau/humanize.git" | ||
| "url": "git://github.com/FGRibreau/humanizer.git" | ||
| }, | ||
| "keywords": [ | ||
| "humanize", | ||
| "value" | ||
| "tool", | ||
| "unit", | ||
| "browser", | ||
| "nodejs" | ||
| ], | ||
@@ -18,0 +21,0 @@ "author": "Francois-Guillaume Ribreau <npm@fgribreau.com> (http://fgribreau.com)", |
+8
-5
@@ -1,7 +0,9 @@ | ||
| Humanize [](https://drone.io/github.com/FGRibreau/humanize/latest) | ||
| Humanizer [](https://drone.io/github.com/FGRibreau/humanizer/latest) | ||
| ======== | ||
| Humanize a value. `Humanize` provides "ago" libraries-like capabilities and so on... | ||
| In fact, unlike other libraries, `humanize` can work with any type of unit and with any scale. | ||
| Humanizer a value. `Humanizer` provides "ago" libraries-like capabilities and so on... | ||
| In fact, unlike other libraries, `humanizer` can work with any type of unit at any scale. | ||
| Humanizer is tested against browsers and NodeJS. | ||
| ```bash | ||
@@ -11,7 +13,8 @@ npm install humanizer | ||
| ```javascript | ||
| var time = require('humanizer'); | ||
| var Humanizer = require('humanizer'); | ||
| // Define the time unit | ||
| time = new Humanize('ms', 1) // the base unit is 1 `ms` | ||
| time = new Humanizer('ms', 1) // the base unit is 1 `ms` | ||
| .unit('day', 24*3600*1000) | ||
@@ -18,0 +21,0 @@ .unit('hour', 3600*1000) |
| var Humanize = require('../Humanize'); | ||
| var _ = require('lodash'); | ||
| var time = null; | ||
@@ -4,0 +5,0 @@ module.exports = { |
9097
2.86%211
3.43%38
8.57%