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

cldr-data

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cldr-data - npm Package Compare versions

Comparing version 0.0.1-alpha.2 to 0.0.1

.jshintrc

24

install.js
/**
* Npm module for Unicode CLDR JSON data v@VERSION
* Npm module for Unicode CLDR JSON data
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* https://github.com/rxaviers/cldr-data/blob/master/LICENSE-MIT
*
* Date: @DATE
* https://github.com/rxaviers/cldr-data-npm/blob/master/LICENSE-MIT
*/
console.log("ENV", JSON.stringify(process.env, null, 2));
console.log("__dirname", __dirname);
"use strict";
var cldrDownloader = require("cldr-data-downloader");
var path = require("path");
cldrDownloader(
"http://www.unicode.org/Public/cldr/26/json.zip",
path.join(__dirname, "json"),
function(error) {
if (error) {
console.error("Whops", error.message);
exit(1);
}
console.log("Done");
}
);
{
"name": "cldr-data",
"version": "0.0.1-alpha.2",
"version": "0.0.1",
"keywords": [
"unicode",
"cldr",
"json",
"CLDR",
"JSON",
"data"
],
"description": "Npm module for Unicode CLDR JSON data",
"homepage": "https://github.com/rxaviers/cldr-data",
"homepage": "https://github.com/rxaviers/cldr-data-npm",
"repository": {
"type": "git",
"url": "git://github.com/rxaviers/cldr-data.git"
"url": "git://github.com/rxaviers/cldr-data-npm.git"
},

@@ -19,3 +19,3 @@ "licenses": [

"type": "MIT",
"url": "https://github.com/rxaviers/cldr-data/blob/master/LICENSE-MIT"
"url": "https://github.com/rxaviers/cldr-data-npm/blob/master/LICENSE-MIT"
}

@@ -28,7 +28,16 @@ ],

},
"main": "index.js",
"scripts": {
"install": "node install.js"
"install": "node install.js",
"test": "grunt"
},
"dependencies": {},
"devDependencies": {}
"dependencies": {
"cldr-data-downloader": "0.0.x"
},
"devDependencies": {
"grunt": "0.4.x",
"grunt-contrib-jshint": "0.10.x",
"grunt-dco": "0.0.3",
"matchdep": "*"
}
}

@@ -1,4 +0,58 @@

cldr-data
=========
# cldr-data-npm
Npm module for Unicode CLDR JSON data
Npm module for [Unicode CLDR JSON][] data
[Unicode CLDR JSON]: http://cldr.unicode.org/index/cldr-spec/json
## Usage
On the `package.json` of your i18n library, define which CLDR versions it's
compatible with.
"dependencies": {
"cldr-data": ">26"
}
On your library, access CLDR JSON data using `require("cldr-data")`.
```javascript
cldr = require("cldr-data");
function Pluralize(locale) {
var plurals = cldr("supplemental/plurals");
var language = extractLanguageFrom(locale);
// Your awesome pluralization logic
pluralForm = doAwesomeStuffWith(
plurals.supplemental["plurals-type-cardinal"][language]
);
return pluralForm;
}
```
For your convinience, use cldr-data in conjunction of [cldr.js][].
[cldr.js]: https://github.com/rxaviers/cldrjs
```javascript
Cldr = require("cldrjs")
cldr = require("cldr-data");
Cldr.load(cldr("supplemental/plurals"));
function Pluralize(locale) {
locale = new Cldr(locale);
// Your awesome pluralization logic
pluralForm = doAwesomeStuffWith(
locale.supplemental("plurals-type-cardinal/{language}")
);
return pluralForm;
}
```
## License
MIT © [Rafael Xavier de Souza](http://rafael.xavier.blog.br)
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