README
# Bulk import folder
Put your files here, then run:
```bash
npm run db:bulk-import
```
## Accepted formats
### 1. JSON files (`.json`)
**Single term per file:**
```json
{
"term": "Trigger Guard",
"description": "The metal loop that wraps around the trigger...",
"category": "Handgun Parts & Components"
}
```
**Multiple terms per file (array):**
```json
[
{ "term": "Frame", "description": "...", "category": "Handgun Parts" },
{ "term": "Slide", "description": "...", "category": "Handgun Parts" }
]
```
Optional: `"aliases": ["Receiver", "Lower"]` — will be added to the description as "Also known as: ...".
### 2. CSV (`.csv`) — 3 columns: term, aliases, description
- **term** — required
- **aliases** — optional (comma-separated)
- **description** — required
**Category comes from the filename:** use `Category_Name_terms.csv`.
The script removes `_terms` and turns underscores into spaces (e.g. `Handgun_Parts_terms.csv` → category "Handgun Parts").
Example:
```csv
term,aliases,description
Trigger Guard,"loop, guard",The metal loop that wraps...
Frame,"Receiver, Lower",The foundational chassis...
```
Filename: `Handgun_Parts_terms.csv` → category "Handgun Parts".
### 3. Text / Markdown (`.txt` or `.md`)
- **Filename** (without extension) = term title (e.g. `Trigger-Guard.txt` → "Trigger Guard")
- **File content** = description
- Category = "General" unless the first line is `category: Category Name`
Place all files in this folder and run `npm run db:bulk-import`.