Installations
npm install koa-locale
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
7.8.0
NPM Version
4.3.0
Score
87.6
Supply Chain
96.3
Quality
75.1
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
koa-modules
Download Statistics
Total Downloads
6,274,275
Last Day
2,004
Last Week
9,895
Last Month
52,823
Last Year
600,816
GitHub Statistics
18 Stars
26 Commits
3 Forks
3 Watching
1 Branches
3 Contributors
Bundle Size
1.95 kB
Minified
699.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.3.0
Package Id
koa-locale@1.3.0
Size
2.51 kB
NPM Version
4.3.0
Node Version
7.8.0
Publised On
12 Apr 2017
Total Downloads
Cumulative downloads
Total Downloads
6,274,275
Last day
1.4%
2,004
Compared to previous day
Last week
-21.6%
9,895
Compared to previous week
Last month
9%
52,823
Compared to previous month
Last year
-14%
600,816
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
koa-locale
Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.
Installation
1$ npm install koa-locale
Usage
1var app = require('koa')(); 2var locale = require('koa-locale'); 3 4// the locale key name defaults to `locale` 5locale(app, 'language'); 6 7app.use(function *(next) { 8 // query: '?language=en' 9 this.body = this.getLocaleFromQuery(); 10});
API
ctx.getLocaleFromQuery(), ctx.request.getLocaleFromQuery()
/?locale=en-US
ctx.getLocaleFromSubdomain(), ctx.request.getLocaleFromSubdomain()
zh-CN.koajs.com
ctx.getLocaleFromHeader(multi = false), ctx.request.getLocaleFromHeader(multi = false)
Accept-Language: zh-CN,zh;q=0.5
ctx.getLocaleFromCookie(), ctx.request.getLocaleFromCookie()
Cookie: locale=zh-TW
ctx.getLocaleFromUrl(options), ctx.request.getLocaleFromUrl(options)
http://koajs.com/en
options = { offset: 2 }
http://koajs.com/foo/bar/en
ctx.getLocaleFromTLD(), ctx.request.getLocaleFromTLD()
http://koajs.com/
http://koajs.cn/
http://koajs.it/
License
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 2/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Reason
27 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-h452-7996-h45h
- Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2
- Warn: Project is vulnerable to: GHSA-9qj9-36jm-prpv
- Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq
- Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp
- Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-8225-6cvr-8pqp
Score
1.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to koa-locale
koa-adam-locale
Simple Multi Language Middleware for Koa.
@ladjs/i18n
i18n wrapper and Koa middleware for Lad
koa-pick-locale
Koa middleware to pick locale from an array of supported locales
mongoose-common-plugin
Common plugin for Mongoose with standard schema fields and localization support