MCPcopy Index your code
hub / github.com/nodejs/node / getTscFromReadme

Function getTscFromReadme

tools/find-inactive-tsc.mjs:49–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49async function getTscFromReadme() {
50 const readmeText = readline.createInterface({
51 input: fs.createReadStream(new URL('../README.md', import.meta.url)),
52 crlfDelay: Infinity,
53 });
54 const returnedArray = [];
55 let foundTscHeading = false;
56 for await (const line of readmeText) {
57 // Until three votes have passed from March 16, 2023, we will need this.
58 // After that point, we can use this for setting `foundTscHeading` below
59 // and remove this.
60 if (line === '#### TSC voting members') {
61 continue;
62 }
63
64 // If we've found the TSC heading already, stop processing at the next
65 // heading.
66 if (foundTscHeading && line.startsWith('#')) {
67 break;
68 }
69
70 const isTsc = foundTscHeading && line.length;
71
72 if (line === '### TSC (Technical Steering Committee)') {
73 foundTscHeading = true;
74 }
75 if (line.startsWith('* ') && isTsc) {
76 const handle = line.match(/^\* \[([^\]]+)]/)[1];
77 returnedArray.push(handle);
78 }
79 }
80
81 if (!foundTscHeading) {
82 throw new Error('Could not find TSC section of README');
83 }
84
85 return returnedArray;
86}
87
88async function getVotingRecords(tscMembers, votes) {
89 const votingRecords = {};

Callers 1

Calls 3

matchMethod · 0.65
createReadStreamMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…