Root structure of a Hashnode export JSON file.
The export file contains an array of posts under the posts key.
posts
import { readFileSync } from 'fs';const exportData: HashnodeExport = JSON.parse( readFileSync('./hashnode-export.json', 'utf-8'));console.log(`Found ${exportData.posts.length} posts`); Copy
import { readFileSync } from 'fs';const exportData: HashnodeExport = JSON.parse( readFileSync('./hashnode-export.json', 'utf-8'));console.log(`Found ${exportData.posts.length} posts`);
Array of blog posts from the Hashnode export
Root structure of a Hashnode export JSON file.
The export file contains an array of posts under the
postskey.Example