New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kmdavis/carmen

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kmdavis/carmen

What in the world is en-US-sandiego?

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Carmen

What in the world is en-US-sandiego?

Build Status Coverage Status Dev Dependencies

Usage

Carmen.js is, in a nutshell, a RFC-4646 & RFC-5646 parser. In other words, Carmen will parse strings like 'en-US-sandiego' and tell you that it refers to the english language, in the United States, specifically, the variant spoken in San Diego.

carmen.parse('en-US');

will return

{
  text: 'en-US',
  language: 'en',
  region: 'US'
}

and

carmen.parse('sl-Latn-IT-nedis');

will return

{
  text: 'sl-Latn-IT-nedis',
  language: 'sl',
  script: 'Latn',
  region: 'IT',
  variants: ['nedis']
}

The full list of fields that Carmen can return is:

{
  text:        String,
  language:    String,
  extlang:    [String],
  script:      String,
  region:      String,
  variants:   [String],
  extensions:  Object,
  private:    [String],
  grandfather: String
}

Please note that the "text" field is Not the original string that is passed in. This string is reconstructed from the parsed values; as such, any minor formatting errors (such as the common Internet Exploder bug where en-US becomes en_US) will be normalized.

Contributing

We use grunt for running tests and such, so, if you want to contribute, you'll want to install grunt's cli sudo npm install -g grunt-cli. Once you have done so, you can run any of our grunt tasks: grunt watch, grunt test, grunt build, grunt release:(major or minor or patch)

License

Copyright 2014 Kevan Davis.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Keywords

FAQs

Package last updated on 07 Jun 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