{"_id":"bcp47-validate","_rev":"337-eb4cc14d08c8a45f46817a6ea3ee0528","name":"bcp47-validate","description":"Simple validator for BCP47 locale tags ","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"bcp47-validate","version":"1.0.0","description":"Simple validator for BCP47 locale tags ","keywords":["bcp47","bcp-47","locale","language","validate","validator"],"license":"Apache-2.0","main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/SafetyCulture/bcp47.git"},"scripts":{"test":"NODE_ENV=test LOG_LEVEL=fatal mocha --recursive --compilers js:babel-register --reporter $npm_package_config_reporter -s 120 $npm_package_config_test_opts","cov":"npm run cov:html","cov:html":"NODE_ENV=test COVERAGE=yes LOG_LEVEL=fatal istanbul --include-all-sources cover -i '**/src/**' --report html ./node_modules/.bin/_mocha -- --recursive --compilers js:babel-register && open coverage/index.html","cov:coveralls":"NODE_ENV=test COVERAGE=yes LOG_LEVEL=fatal istanbul cover --report lcovonly ./node_modules/.bin/_mocha -- --compilers js:babel-register --recursive  && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","lint":"eslint ./src/ ./test/ && echo Lint OK","compile":"babel src --out-dir dist --source-maps true","compile:watch":"babel src --out-dir dist --source-maps true --watch","deps":"npm run deps:missing && npm run deps:extra","deps:missing":"dependency-check package.json","deps:extra":"dependency-check package.json --extra --no-dev --ignore","audit":"nsp check","check":"npm run audit && npm run deps && npm outdated --depth 0","clean":"rm -rf node_modules/ && rm -rf coverage","prepublish":"npm run compile && npm test","pretest":"npm run lint"},"author":{"url":"C"},"config":{"reporter":"spec","test_opts":"test/"},"devDependencies":{"babel-cli":"^6.10.1","babel-eslint":"^6.1.0","babel-preset-es2015":"^6.9.0","babel-register":"^6.9.0","chai":"^3.5.0","chai-as-promised":"^5.3.0","coveralls":"^2.13.1","dependency-check":"^2.5.1","eslint":"^2.13.1","eslint-config-airbnb":"^9.0.1","eslint-plugin-import":"^1.9.2","eslint-plugin-jsx-a11y":"^1.5.3","eslint-plugin-react":"^5.2.2","istanbul":"^1.0.0-alpha.2","lodash":"^4.15.0","mocha":"^2.5.3","nock":"^8.0.0","nsp":"^2.5.0"},"dependencies":{},"babel":{"presets":["es2015"]},"gitHead":"e1afa0b61f932462f46c87195c746b0aade467ac","bugs":{"url":"https://github.com/SafetyCulture/bcp47/issues"},"homepage":"https://github.com/SafetyCulture/bcp47#readme","_id":"bcp47-validate@1.0.0","_shasum":"e771f485a238b6873cd6cc950fe018315423cc26","_from":".","_npmVersion":"2.15.12","_nodeVersion":"4.4.2","_npmUser":{"name":"safetyculture","email":"admin@safetyculture.io"},"dist":{"shasum":"e771f485a238b6873cd6cc950fe018315423cc26","tarball":"https://registry.npmjs.org/bcp47-validate/-/bcp47-validate-1.0.0.tgz","integrity":"sha512-gTO4Sl/XyB+drQ+yKU0PbpFqWjPvhCuv2F3a73Hv8HLdC4Qd1V58TNUZpRUzYFq6rxD3vCBeokp6vmhJn+6U1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoDxkJWMlti81tXYS6IaPmC7AxFIjhK9tesCoFaZA8pAIgb0ZhVj13Kyr+FbaxfkAAZe68V74nbUjOYdQQ5rS5PfM="}]},"maintainers":[{"name":"safetyculture","email":"admin@safetyculture.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp47-validate-1.0.0.tgz_1503478251662_0.916492807911709"},"directories":{}}},"readme":"# bcp47\n\n[![Build Status](https://travis-ci.org/SafetyCulture/bcp47.svg?branch=master)](https://travis-ci.org/SafetyCulture/bcp47)\n[![Coverage Status](https://coveralls.io/repos/github/SafetyCulture/bcp47/badge.svg)](https://coveralls.io/github/SafetyCulture/bcp47)\n\nSimple validator for BCP47 locale tags\n\nHelpful resources: \n* http://www.w3.org/International/questions/qa-choosing-language-tags\n* https://tools.ietf.org/html/bcp47\n* http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry\n\n# Usage\n\n## Install\n```sh\n$ npm i @safetyculture/bcp47 --save\n```\n\n## Importing\n```js\nimport {validate, pattern} from 'bcp47';\n```\n\n# Properties\n\n## pattern\nA regular expression for validating locale strings\n\n```js\n// use with third party validation tools\nJoi.string().regex(pattern)\n\n// or just regex\npattern.test(locale);\n```\n\n# Methods\n\n## validate(`locale`) => Boolean\nValidate a given locale string.\n- `locale`. Example `en-US`\n\n```js\nvalidate('en-US'); // true\nvalidate('en_US'); // false\n```\n","maintainers":[{"email":"tristan@tristandavey.com","name":"tjdavey"}],"time":{"modified":"2022-08-15T00:18:25.140Z","created":"2017-08-23T08:50:51.746Z","1.0.0":"2017-08-23T08:50:51.746Z"},"homepage":"https://github.com/SafetyCulture/bcp47#readme","keywords":["bcp47","bcp-47","locale","language","validate","validator"],"repository":{"type":"git","url":"git+https://github.com/SafetyCulture/bcp47.git"},"author":{"url":"C"},"bugs":{"url":"https://github.com/SafetyCulture/bcp47/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}