1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-23 13:43:11 +02:00

Try a new approach

This commit is contained in:
Julien Déramond
2023-03-21 18:56:55 +01:00
parent 622457b56d
commit d51d849da0
15 changed files with 1449 additions and 1893 deletions

22
build/glossary.mjs Normal file
View File

@@ -0,0 +1,22 @@
import * as path from 'path';
import { argv } from 'node:process';
import * as fs from 'fs/promises';
import { getCssClasses } from './getCssClasses.mjs';
try {
const args = argv.slice(2);
const fileClasses = await getCssClasses(args[0]);
const outputFilePath = args[1] ?? `${path.parse(args[0]).name}.json`
await fs.writeFile(outputFilePath, JSON.stringify(fileClasses))
}
catch (error) {
// console.log(error)
// TODO: inputPath could be an HTTP link
console.log(`Usage: node glossary.mjs <inputPath> <outputPath>
- inputPath: CSS file to parse
- outputPath: JSON file (optional). Default value is: <inputPath>.json
`)
}