Gathering detailed insights and metrics for babel-gettext-extractor
Gathering detailed insights and metrics for babel-gettext-extractor
Gathering detailed insights and metrics for babel-gettext-extractor
Gathering detailed insights and metrics for babel-gettext-extractor
A fork of babel-gettext-plugin that works with older versions of node and supports comment and location extraction
npm install babel-gettext-extractor
Typescript
Module System
76.3
Supply Chain
97
Quality
80.3
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
43 Stars
104 Commits
22 Forks
60 Watchers
9 Branches
268 Contributors
Updated on Mar 29, 2024
Minified
Minified + Gzipped
Latest Version
4.1.3
Package Id
babel-gettext-extractor@4.1.3
Unpacked Size
19.16 kB
Size
5.97 kB
File Count
14
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Extract gettext string with babel support syntax JSX, ES6, ... It is based on
node-gettext. This is a fork of the npm module babel-gettext-plugin
which
adds support for references and runs on earlier versions of node.
Supports babel 7.
yarn add babel-gettext-extractor
or
npm install --save babel-gettext-extractor
1var babel = require("babel"); 2 3babel.transform(code, { plugins:["babel-gettext-extractor"]});
babel --plugins babel-gettext-extractor code.js
1"plugins": [ 2 [ "babel-gettext-extractor", { 3 "headers": <Object>, 4 "functionNames": <Object>, 5 "fileName": <String|Function>, 6 "baseDirectory": <String>, 7 "stripTemplateLiteralIndent": <Boolean> 8 }] 9]
The headers to put in the po file.
1headers: { 2 "content-type": "text/plain; charset=UTF-8", 3 "plural-forms": "nplurals=2; plural=(n!=1);" 4}
A list of function names to extract. The list is the definition of the
parameters: "domain"
, "msgctxt"
, "msgid"
, "msgid_plural"
and
"count"
example:
1functionNames: { 2 myfunction: ["msgid"] 3}
The filename where the end result is placed. If you supply a function, it will receive the current file babel is working on and you can return the full path to where you want to save your translation template for this particular file.
example:
1[ 2 require("babel-gettext-extractor"), 3 { 4 fileName: (file) => { 5 const sourceFile = file.opts.sourceFileName; 6 if (/^node_modules\//.test(sourceFile)) { 7 return false; 8 } 9 return sourceFile 10 .split(/[\/\\.]/) 11 .filter(name => !['src', 'packages', 'js'].includes(name)) 12 .slice(0, 2) 13 .join('-') + '-template.pot'; 14 }, 15 }, 16]
If provided, then file names are chopped off in relation to this base path if filenames start with that path.
If true this will strip leading indents from multiline strings. Note: this requires gettext function implementations to do the same leading indent removal. Useful if you want to use Template literals for multiline strings to be passed into to gettext functions.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 3/15 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
22 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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 More