utils/scripts/create-index.js
Martin Donnelly c30b36b3f6 init
2020-11-17 11:16:34 +00:00

13 lines
436 B
JavaScript

const fs = require('fs');
const path = require('path');
const content = fs
.readdirSync(path.join(__dirname, '../ts-src'))
.filter((name) => name.endsWith('.ts') && !name.includes('test.ts') && !name.startsWith('_'))
.map((name) => name.replace('.ts', ''))
.filter((name) => name !== 'index')
.map((name) => `export * from './${name}';`)
.join('\n');
fs.writeFileSync(path.join(__dirname, '../ts-src/index.ts'), content);