Gathering detailed insights and metrics for vscode-textmate-webpack
Gathering detailed insights and metrics for vscode-textmate-webpack
Gathering detailed insights and metrics for vscode-textmate-webpack
Gathering detailed insights and metrics for vscode-textmate-webpack
A library that helps tokenize text using Text Mate grammars.
npm install vscode-textmate-webpack
Typescript
Module System
76
Supply Chain
95.5
Quality
75
Maintenance
100
Vulnerability
98.9
License
TypeScript (83.52%)
JavaScript (2.33%)
SCSS (2.25%)
Groovy (1.47%)
CSS (1.22%)
HTML (0.94%)
Python (0.79%)
Perl (0.72%)
Ruby (0.64%)
PowerShell (0.53%)
Objective-C (0.52%)
Go (0.46%)
Clojure (0.45%)
Handlebars (0.4%)
Less (0.38%)
C++ (0.37%)
Visual Basic .NET (0.33%)
C (0.31%)
PHP (0.3%)
F# (0.24%)
Shell (0.24%)
CoffeeScript (0.22%)
Java (0.21%)
Makefile (0.21%)
Rust (0.2%)
Batchfile (0.18%)
Dockerfile (0.16%)
R (0.14%)
ShaderLab (0.12%)
Lua (0.09%)
Swift (0.08%)
Pug (0.01%)
Total Downloads
1,192
Last Day
1
Last Week
2
Last Month
10
Last Year
105
MIT License
624 Stars
473 Commits
118 Forks
57 Watchers
5 Branches
71 Contributors
Updated on Jul 01, 2025
Minified
Minified + Gzipped
Latest Version
3.3.3
Package Id
vscode-textmate-webpack@3.3.3
Unpacked Size
488.53 kB
Size
90.35 kB
File Count
63
Cumulative downloads
Total Downloads
2
7
An interpreter for grammar files as defined by TextMate. Supports loading grammar files from JSON or PLIST format. Cross - grammar injections are currently not supported.
1npm install vscode-textmate
1var Registry = require('vscode-textmate').Registry; 2var registry = new Registry(); 3var grammar = registry.loadGrammarFromPathSync('./javascript.tmbundle/Syntaxes/JavaScript.plist'); 4 5var lineTokens = grammar.tokenizeLine('function add(a,b) { return a+b; }'); 6for (var i = 0; i < lineTokens.tokens.length; i++) { 7 var token = lineTokens.tokens[i]; 8 console.log('Token from ' + token.startIndex + ' to ' + token.endIndex + ' with scopes ' + token.scopes); 9}
Sometimes, it is necessary to manage the list of known grammars outside of vscode-textmate
. The sample below shows how this works:
1var Registry = require('vscode-textmate').Registry; 2 3var registry = new Registry({ 4 getFilePath: function (scopeName) { 5 // Return here the path to the grammar file for `scopeName` 6 if (scopeName === 'source.js') { 7 return './javascript.tmbundle/Syntaxes/JavaScript.plist'; 8 } 9 return null; 10 } 11}); 12 13// Load the JavaScript grammar and any other grammars included by it async. 14registry.loadGrammar('source.js', function(err, grammar) { 15 if (err) { 16 console.error(err); 17 return; 18 } 19 20 // at this point `grammar` is available... 21}); 22
To tokenize multiple lines, you must pass in the previous returned ruleStack
.
1var ruleStack = null; 2for (var i = 0; i < lines.length; i++) { 3 var r = grammar.tokenizeLine(lines[i], ruleStack); 4 console.log('Line: #' + i + ', tokens: ' + r.tokens); 5 ruleStack = r.ruleStack; 6}
See the main.ts file
npm install
npm run watch
npm test
npm run benchmark
npm run inspect -- PATH_TO_GRAMMAR PATH_TO_FILE
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
security policy file detected
Details
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
branch protection is not maximal on development and all release branches
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
1 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
SAST tool is not run on all commits -- score normalized to 0
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 MoreLast Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
11.1%
10
Compared to previous month
Last Year
84.2%
105
Compared to previous year