mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Port the unit tests from https://github.com/vercel/nft/tree/941be1cb3b9d38fbc99a8a6f07af568a64ed0f12/test/unit
12 lines
284 B
JavaScript
12 lines
284 B
JavaScript
const { resolve } = require('path')
|
|
const fs = require('fs')
|
|
const { readdir } = fs.promises
|
|
|
|
async function getPosts() {
|
|
const postsDirectory = resolve(process.cwd(), '_posts')
|
|
const postFiles = await readdir(postsDirectory)
|
|
return postFiles
|
|
}
|
|
|
|
getPosts().catch(console.error)
|