Command line and JavaScript¶
The reference analyzer is the npm package @lydite/analyzer (Node.js 20 or newer). It runs
locally and uploads nothing.
Command line¶
npx @lydite/analyzer responses.csv --out results/
This writes lydite_results.csv, lydite_fields.csv, lydite_report.html and
lydite_methods.txt to results/.
| Option | Purpose |
|---|---|
--out <dir> |
Output directory (default: current directory) |
--id <column> |
Respondent id column (default: detected; for example ResponseId, participant_id, PROLIFIC_PID, subject) |
--map <fieldId=column> |
Answer column for a field, when its name differs from the fieldId (repeatable) |
--require <column> |
Answer column that must have integrity data (repeatable) |
--key-var <column> |
Outcome variable for the sensitivity table (repeatable) |
--weak-outcome <class> |
Class for weak evidence only: human_likely (default) or review |
--single-medium <class> |
Class for exactly one medium reason: review (default) or human_likely |
--title <text> |
Report title |
--require tells the analyzer that an answer in this column should have integrity data next
to it. If the answer is there but its payload is missing (for example because JavaScript was
blocked), the respondent gets LYD-TELEMETRY-MISSING and the class insufficient_data.
JavaScript¶
import { readFileSync } from 'node:fs';
import { analyzeText, resultsCsv, summarize, methodsText } from '@lydite/analyzer';
const results = analyzeText(readFileSync('responses.csv', 'utf8'), { requiredColumns: ['Q1'] });
console.log(summarize(results));
console.log(methodsText(summarize(results), { preregistered: true }));
analyzeText accepts the same options as the command line. You can also pass rules, to
override individual thresholds, and canaryWords, if you gave the collector your own word
list. Results are byte-identical to the R and Python packages.