mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
change doc gen
This commit is contained in:
25
docs/generator/doc-scanner.js
Normal file
25
docs/generator/doc-scanner.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/* eslint no-console:0 no-return-assign:0 */
|
||||
const parse = require('jsdoc-parse');
|
||||
|
||||
module.exports = class DocumentationScanner {
|
||||
constructor(generator) {
|
||||
this.generator = generator;
|
||||
}
|
||||
|
||||
scan(directory) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const stream = parse({
|
||||
src: [`${directory}*.js`, `${directory}**/*.js`],
|
||||
private: true,
|
||||
});
|
||||
|
||||
let json = '';
|
||||
stream.on('data', chunk => json += chunk.toString('utf-8'));
|
||||
stream.on('error', reject);
|
||||
stream.on('end', () => {
|
||||
json = JSON.parse(json);
|
||||
resolve(json);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user