Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gazay/node-emoji-clock
https://github.com/gazay/node-emoji-clock
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gazay/node-emoji-clock
- Owner: gazay
- License: mit
- Created: 2016-06-17T20:03:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-18T05:31:59.000Z (over 7 years ago)
- Last Synced: 2024-10-15T07:04:48.190Z (30 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 78
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🕠node-emoji-clock: It's time to show time ðŸ•
[![Build Status](https://travis-ci.org/gazay/node-emoji-clock.svg)](https://travis-ci.org/gazay/node-emoji-clock) [![NPM version](https://badge.fury.io/js/node-emoji-clock.svg)](https://www.npmjs.com/package/node-emoji-clock)Shows time with emoji
## Install
```
npm install node-emoji-clock
```## Usage
With `Date` object:
```js
const clock = require('node-emoji-clock');const time = new Date();
console.log(time);
// 2016-06-17T20:41:02.705Zconsole.log(clock.timeToEmoji(time));
// ðŸ•console.log(clock.timeToEmoji(time, { utc: true }));
// 🕣time.setHours(9);
time.setMinutes(12);console.log(clock.timeToEmoji(time));
// 🕘console.log(clock.timeToEmoji(time, { utc: true })); // '
// 🕛
```With [momentjs](http://momentjs.com/) object:
```js
const clock = require('node-emoji-clock');
const moment = require('moment');const mTime = moment();
console.log(mTime.toString());
// Fri Jun 17 2016 17:41:02 GMT-0300console.log(clock.timeToEmoji(mTime));
// ðŸ•console.log(clock.timeToEmoji(mTime, { utc: true }));
// 🕣mTime.hour(9);
mTime.minute(12);console.log(clock.timeToEmoji(mTime));
// 🕘console.log(clock.timeToEmoji(mTime, { utc: true }));
// 🕛
```## License
The MIT License