Skip to content
🌛 Return an emoji representing the current moon phase.
JavaScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore moon! Dec 23, 2015
.travis.yml Update standard to the latest version 🚀 (#32) Aug 29, 2018
LICENSE
README.md Update dependencies to enable Greenkeeper 🌴 (#20) Jun 17, 2018
cli.js
example.js Add tonicExampleFilename Jan 2, 2016
help.js Update help output Jun 17, 2016
index.js 👋 mocha (#14) Feb 23, 2017
package.json chore(package): update standard to version 13.0.1 (#33) Jul 12, 2019
test.js 👋 mocha (#14) Feb 23, 2017

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

You can’t perform that action at this time.