Gathering detailed insights and metrics for gettext-extractor
Gathering detailed insights and metrics for gettext-extractor
Gathering detailed insights and metrics for gettext-extractor
Gathering detailed insights and metrics for gettext-extractor
gettext-extractor-vue
Extend gettext-extractor with the possibility to parse Vue single file components
babel-gettext-extractor
Extract gettext string with babel
gettext-extractor-svelte
gettext-extractor for svelte files
ts-gettext-extractor-linux-x64-musl
OS-specific binary for [ts-gettext-extractor](https://github.com/louy/ts-gettext-extractor).
A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript, JSX and HTML.
npm install gettext-extractor
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.8
Supply Chain
94.6
Quality
82
Maintenance
100
Vulnerability
98.2
License
TypeScript (99.37%)
HTML (0.33%)
JavaScript (0.3%)
Total Downloads
19,694,388
Last Day
2,905
Last Week
85,766
Last Month
488,680
Last Year
5,579,174
MIT License
104 Stars
105 Commits
23 Forks
4 Watchers
8 Branches
18 Contributors
Updated on Jul 07, 2025
Minified
Minified + Gzipped
Latest Version
3.8.0
Package Id
gettext-extractor@3.8.0
Unpacked Size
70.81 kB
Size
15.28 kB
File Count
51
NPM Version
9.5.1
Node Version
18.16.1
Published on
Jul 15, 2023
Cumulative downloads
Total Downloads
Last Day
-28.7%
2,905
Compared to previous day
Last Week
-39.5%
85,766
Compared to previous week
Last Month
-15.1%
488,680
Compared to previous month
Last Year
69.3%
5,579,174
Compared to previous year
5
A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript, JSX and HTML
It works by running your files through a parser and then uses the AST (Abstract Syntax Tree) to find and extract translatable strings from your source code. All extracted strings can then be saved as .pot
file to act as template for translation files.
Unlike many of the alternatives, this library is highly configurable and is designed to work with most existing setups.
For the full documentation check out the Github Wiki.
Note: This package requires Node.js version 6 or higher.
1yarn add gettext-extractor
1npm install gettext-extractor
Let's start with a code example:
1const { GettextExtractor, JsExtractors, HtmlExtractors } = require('gettext-extractor'); 2 3let extractor = new GettextExtractor(); 4 5extractor 6 .createJsParser([ 7 JsExtractors.callExpression('getText', { 8 arguments: { 9 text: 0, 10 context: 1 11 } 12 }), 13 JsExtractors.callExpression('getPlural', { 14 arguments: { 15 text: 1, 16 textPlural: 2, 17 context: 3 18 } 19 }) 20 ]) 21 .parseFilesGlob('./src/**/*.@(ts|js|tsx|jsx)'); 22 23extractor 24 .createHtmlParser([ 25 HtmlExtractors.elementContent('translate, [translate]') 26 ]) 27 .parseFilesGlob('./src/**/*.html'); 28 29extractor.savePotFile('./messages.pot'); 30 31extractor.printStats();
A detailed explanation of this code example and much more can be found in the Github Wiki.
From reporting a bug to submitting a pull request: every contribution is appreciated and welcome. Report bugs, ask questions and request features using Github issues. If you want to contribute to the code of this project, please read the Contribution Guidelines.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/30 approved changesets -- score normalized to 1
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
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
37 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