🌛 Return an emoji representing the current moon phase.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
cli.js
example.js
help.js
index.js
package.json
test.js

README.md

moonmoji

moonmoji

Greenkeeper badge

NPM

NPM

build status dependency status devDependency status js-standard-style npm-version npm-downloads

js-standard-style


Return an emoji representing the current moon phase.

Install

$ npm install --save moonmoji

Usage

var moonmoji = require('moonmoji')();

console.log(moonmoji);
// => { emoji: '🌗', name: 'Last Quarter' }

CLI

$ npm install --global moonmoji
$ moonmoji --help

  Return an emoji representing the current moon phase.

  Usage
    moonmoji
    => 🌗

    moonmoji --verbose
    => { emoji: '🌔',
    =>   code: ':waxing_gibbous_moon:',
    =>   name: 'Waxing Gibbous',
    =>   weight: 6.3825 }

    moonmoji --code
    => :new_moon_with_face:

    moonmoji --version
    => 1.1.2

In your bash

The main goal of this was to have the emoji display in a shell. This can be accomplished by adding the script to your PS1 export in your .bash_prompt or similar, eg:

PS1=$(moonmoji);
export PS1;

Examples:

prompt 1 prompt 2

  • note: If you have additional information in your PS1 you'll need to have two spaces after the emoji character.

Thanks

@lauradegroot for inspiration
@bwinton for pretty much authoring the whole thing
@matiassingers for tests!
The whole meatspace community for being awesome.

Licence

MIT