electron/script/create-api-json.js
Milan Burda abec9ead06
refactor: use node scheme imports in scripts (#38846)
* refactor: use node scheme imports in script

* refactor: use node scheme imports in build
2023-06-22 16:21:42 +02:00

17 lines
526 B
JavaScript

const { parseDocs } = require('@electron/docs-parser');
const fs = require('node:fs');
const path = require('node:path');
const { getElectronVersion } = require('./lib/get-version');
parseDocs({
baseDirectory: path.resolve(__dirname, '..'),
packageMode: 'single',
useReadme: false,
moduleVersion: getElectronVersion()
}).then((api) => {
return fs.promises.writeFile(path.resolve(__dirname, '..', 'electron-api.json'), JSON.stringify(api, null, 2));
}).catch((err) => {
console.error(err);
process.exit(1);
});