# CSV Import Previewer 1.0.0 Preview every create, update, unchanged record and error against an existing snapshot. No database integration, writes, account or subscription is required. Node 20+ with no npm dependencies. Includes local UI, CLI, sample input and tests. ## Run Extract the ZIP, run `node app.mjs`, and open the complete local URL it prints. Load the sample to see the input structure. Load your configuration JSON and optionally replace its csv property using the separate CSV file picker. Review mappings and the existing snapshot in the editor, then click **Preview import**. Download the full JSON report or row-by-row preview CSV. Ctrl+C stops the loopback server. CLI: `node cli.mjs examples/input.json new-report.json` (append `csv` for a CSV report). Existing outputs are refused. Exit 0 means report created, not that every row is valid; inspect summary.error. Exit 2 means invalid configuration, CSV or output failure. ## Input contract The JSON has csv (comma-separated text), key (the identifying field), fields (explicit mapping and rules), and optional existing (a snapshot array). See examples/input.json. Every field declares column, type (string, number or date), and required (boolean). Optional min/max apply to numbers; enum is a list of literal allowed strings. No arbitrary regular expressions or executable validators are accepted. Identifiers must be required string fields. Each field maps to one unique, exact CSV header. Existing records use exact string values, with unique, nonempty keys. Numbers are validated as plain decimals and dates as real YYYY-MM-DD calendar dates. All proposed values remain strings, preserving leading zeros and decimal precision; no numeric conversion is exported. Bounds use JavaScript numeric comparison, so use string-only fields for quantities requiring arbitrary-precision range comparisons. All copies of duplicated input keys become errors. Missing fields and invalid values appear per record. Updates compare mapped fields to the existing snapshot; other fields are retained in existing evidence and are not proposed for deletion. Whitespace is preserved, not silently trimmed. Unmapped columns are explicitly reported and excluded from proposed records. CSV row numbers count logical data records, not lines inside quoted fields. Unknown headers do not silently become database fields. Limits: 5 MiB input, 10000 records, 100 columns/fields, 20000 characters per cell. CSV supports UTF-8 BOM, CRLF/LF, quoted commas, doubled quotes and embedded newlines. Malformed quoting, duplicate/blank headers and inconsistent row widths are refused. Only comma-separated UTF-8 input is supported. Export spreadsheets to CSV first. JSON contains all records, before/after changes, errors and an input SHA-256. CSV is a review report, not a database import file; it protects formula-like prefixes. Nothing contacts or changes a database. This product intentionally has no commit feature: any real import must implement its own permissions and transaction handling. Snapshot freshness and correctness remain the user's responsibility. ## Verify Run `node --test tests/product.test.mjs`. Tests cover strict parsing, dates and numbers, duplicate handling, preservation, real CLI exports and local HTTP processing.