
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vite-plugin-collections
Advanced tools
A Vite plugin for working with folders of markdown content.
A simple solution for building blog and docs sites.
Install the plugin:
pnpm install -D vite-plugin-collections
Add plugin to vite.config.ts:
import { defineConfig } from 'vite'
import collection from 'vite-plugin-collections'
import * as z from 'zod'
export default defineConfig({
plugins: [
// matches src/posts/*.md
collection({
// use folder src/posts
base: 'posts',
// front matter fields use a Zod schema
fields: z.object({
title: z.string().nonempty(),
banner: z.url(),
summary: z.string().optional(),
date: z.iso.date(),
tags: z.array(z.string()).optional(),
})
})
]
})
[!NOTE] This will add an import alias
#posts, use that to access the markdown files.
To load the list of markdown files:
import { list } from '#posts'
const posts = await list()
To load a single markdown file:
import { get } from '#posts'
const post = await get(slug)
Types definitions are generated in collections.d.ts.
Add it to your tsconfig.json:
"files": [
"collections.d.ts"
]
MIT
FAQs
A vite plugin for working with directories of markdown
We found that vite-plugin-collections demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.