Comparing version 0.0.1-alpha.2 to 0.0.1
/** | ||
* 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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7608
10
91
59
1
4
1
+ Addedcldr-data-downloader@0.0.x
+ Addedabbrev@1.1.1(transitive)
+ Addedadm-zip@0.4.4(transitive)
+ Addedasn1@0.1.11(transitive)
+ Addedassert-plus@0.1.5(transitive)
+ Addedasync@0.9.2(transitive)
+ Addedaws-sign2@0.5.0(transitive)
+ Addedbl@0.9.5(transitive)
+ Addedboom@0.4.2(transitive)
+ Addedcaseless@0.6.0(transitive)
+ Addedcldr-data-downloader@0.0.9(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addedconfig-chain@1.1.13(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcryptiles@0.2.2(transitive)
+ Addedctype@0.5.3(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addedforever-agent@0.5.2(transitive)
+ Addedform-data@0.1.4(transitive)
+ Addedhawk@1.1.1(transitive)
+ Addedhoek@0.9.1(transitive)
+ Addedhttp-signature@0.10.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedmime@1.2.11(transitive)
+ Addedmime-types@1.0.2(transitive)
+ Addedminimist@0.0.8(transitive)
+ Addedmkdirp@0.5.0(transitive)
+ Addednode-uuid@1.4.8(transitive)
+ Addednopt@3.0.6(transitive)
+ Addednpmconf@2.0.9(transitive)
+ Addedoauth-sign@0.4.0(transitive)
+ Addedonce@1.3.3(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedosenv@0.1.5(transitive)
+ Addedprogress@1.1.8(transitive)
+ Addedproto-list@1.2.4(transitive)
+ Addedq@1.0.1(transitive)
+ Addedqs@1.2.2(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedrequest@2.44.0(transitive)
+ Addedrequest-progress@0.3.1(transitive)
+ Addedsemver@4.3.6(transitive)
+ Addedsntp@0.2.4(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedstringstream@0.0.6(transitive)
+ Addedthrottleit@0.0.2(transitive)
+ Addedtldts@6.1.68(transitive)
+ Addedtldts-core@6.1.68(transitive)
+ Addedtough-cookie@5.0.0(transitive)
+ Addedtunnel-agent@0.4.3(transitive)
+ Addeduid-number@0.0.5(transitive)
+ Addedwrappy@1.0.2(transitive)