# MSC NodeJS milliseconds converter
Install
Use NPM:
$ npm install ms-c
Usage
Sample:
require('ms-c');
console.log( msc( [ms, unit], callback ) );
Example: Synchronus:
require('ms-c');
var ms = d.getDate();
var time = msc(ms, 'years') + ' years'
console.log(time); // => 47 years
// or
console.log( 'Seconds: ' + msc(1000, 'seconds') );
// => return 'Seconds: 1'
Asynchronus:
require('ms-c');
msc(1500, 'seconds', (err, data) => {
if (err) throw err;
console.log('Seconds: ' + data);
});
See example.js for a detailed example.
## API msc([ms, unit], callback)
ms
Type: number
unit
Type: string
Units
- seconds
- hours
- days
- weeks
- years
### callback
Type: function
Callback return err
& data
.
Example:
require('msc');
msc(1000, 'seconds', (err, data) => {
console.log(data);
})