Download slate/site/pages/api/index.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 290 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/site/pages/api/index.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/site/pages/api/index.ts
-
curl -L -o index.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/site/pages/api/index.ts
290 Bytes
| 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$/, '')) | |
| } | |