@jackens/from-now
v1.6.14
Published
‘from-now’ provides function ‘fromNow’ similar to moment.js’ one. Works in both Node.js and the browser.
Downloads
37
Readme
from-now
‘from-now’ provides function fromNow
similar to moment.js’ one.
Works in both Node.js and the browser.
Install
NPM
npm install @jackens/from-now
CDN
<script type="text/javascript" src="https://cdn.rawgit.com/jackens/from-now/master/from-now.js"></script>
or
<script type="text/javascript" src="https://cdn.rawgit.com/jackens/from-now/master/from-now.min.js"></script>
or
<script type="text/javascript" src="https://unpkg.com/@jackens/from-now/from-now.js"></script>
or
<script type="text/javascript" src="https://unpkg.com/@jackens/from-now/from-now.min.js"></script>
Usage
var fromNow = require('@jackens/from-now')
// fromNow.lang = 'pl' // default
console.log(fromNow('2018-04-24T23:59:59.999Z'))
fromNow.lang = 'en'
console.log(fromNow('2018-04-24T23:59:59.999Z'))
Translations can be easily extended or modified
console.log(fromNow.langs)