Git Product home page Git Product logo

birthgem's Introduction

License: MIT

Birthgem

Determines the birthstones from the given month, day of the week or zodiac sign.

This is based on ekimng's package.

  • The stone names and zodiac signs names can be in different languages.
  • All results are returned into an array except for error codes which are negative integers.

Functions dedicated to zodiac signs are deprecated. Use the package zodiac-signs instead.

Installation

You have to add this module to your npm modules folder.

$ npm install birthgem

Example

Importing the module

const birthgem = require('birthgem')('en');
// Require with a language (format xx-YY sets (format xx)
const birthgem = require('birthgem')('en-US')
// Require without an argument sets 'en'
const birthgem = require('birthgem')();

Displaying a month birthstone

// Returns the birthstone of the present month
console.log(birthgem.month());
// Returns the birthstone of January (values: [1;12])
console.log(birthgem.month(1));
// Overload the default language (format xx-YY sets (format xx)
console.log(birthgem.month(1, 'fr'));

Displaying a day of the week birthstone

// Returns the birthstone of the present day
console.log(birthgem.day());
// Returns the birthstone of Monday (values: [1;7])
console.log(birthgem.day(1));
// Overloads the default language (format xx-YY sets (format xx)
console.log(birthgem.day(1, 'fr'));

Displaying a zodiac sign birthstone

Those functions have been removed. Use the package zodiac-signs instead.

Error management

An integer is returned if the given parameter is wrong:

Type Values Error code
Day [1;7] -1
Month [1;12] -2

Translation

You are free to participate to the translation in any other language.

Avaible languages

  • English
  • French
  • German
  • Italian
  • Portuguese
  • Spanish

Thanks

Thanks to ekimng for the original package: birthstone.

License

birthgem's People

Contributors

helmasaur avatar

Watchers

 avatar  avatar

birthgem's Issues

What to do with languages which have variations? (ex: Portuguese)

A very little strings in Portuguese (#7) and perhaps Spanish (#4) are different depending on the country. Example: Portugal and Brasil for Portuguese.

Is it important to get display both spellings? If any person whose language have strong variation uses this package, please give me a feedback (it can be an other language than Portuguese or Spanish).

Check bloodstone translations

Bloodstones are heliotropes but I don't know if other languages uses "bloodstone" too for jewels. If anyone has the information, whatever language it is, please leave a comment!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.