File size: 290 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 |
import { readdirSync } from 'fs'
import { join } from 'path'
const examplePath = join(process.cwd(), 'examples/ts')
export function getAllExamples() {
const slugs = readdirSync(examplePath)
return slugs
.filter(name => name.match(/.tsx$/))
.map(n => n.replace(/.tsx$/, ''))
}
|