Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

evenin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evenin

Ever wondered if a text contained a greeting? Then needed that functionality in over a thousand languages and dialects? Me neither.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Evenin' npm version

Detect, search and list general greetings for a large amount of languages.

Install

$ npm install --save evenin

Usage

const greetings = require("evenin");

// Check if a string contains a greeting:
greetings.hasGreeting("Hello, world!");
//=> true
greetings.hasGreeting("Goodbye, world!");
//=> false

// Check if a string _is_ a greeting:
greetings.isGreeting("hello");
//=> true
greetings.isGreeting("goodbye");
//=> false

// Look up a specific greeting across all languages:
greetings.findGreetings("hello");
//=> [ { phrase: 'Hello',
//     explanation: 'formal greeting',
//     language:
//      { name: 'English',
//        url: 'http://www-01.sil.org/iso639-3/documentation.asp?id=eng',
//        location: 'United Kingdom, United States of America, Canada, Australia, various other countries.',
//        greetings: [Array] } },
//   { phrase: 'Hello',
//     explanation: 'general greeting',
//     language:
//      { name: 'Guyanese Creole',
//        url: 'http://www-01.sil.org/iso639-3/documentation.asp?id=gyn',
//        location: 'Guyana.',
//        greetings: [Array] } },
//   { phrase: 'Hello',
//     explanation: 'general greeting',
//     language:
//      { name: 'Malay, Central',
//        url: 'http://www-01.sil.org/iso639-3/documentation.asp?id=pse',
//        location: 'Indonesia: Sumatra.',
//        greetings: [Array] } } ]

// Look up all greetings starting with the specified prefix:
greetings.findGreetings("g'");
//=> [ { phrase: 'G\'day',
//     explanation: 'general greeting used in some parts of Australia [eng-aus]',
//     language:
//      { name: 'English',
//        url: 'http://www-01.sil.org/iso639-3/documentation.asp?id=eng',
//        location: 'United Kingdom, United States of America, Canada, Australia, various other countries.',
//        greetings: [Array] } } ]

// Find information on a language and all greetings logged for that language:
greetings.getLanguage("english");
//=> { name: 'English',
//   url: 'http://www-01.sil.org/iso639-3/documentation.asp?id=eng',
//   location: 'United Kingdom, United States of America, Canada, Australia, various other countries.',
//   greetings:
//    [ { phrase: 'Hello', explanation: 'formal greeting' },
//      { phrase: 'Hi', explanation: 'informal greeting' },
//      ...
//    ] }

Disclaimer

This project is largely a joke and hasn't really been tested. If you run into a problem, feel free to make an issue though. I'd be interested to see if people have an actual use for this. All the greetings are from Jennifer's Language Page which is honestly an amazing resource.

License

MIT © Thijs Molendijk (molenzwiebel)

FAQs

Package last updated on 27 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc