--- package.json --- { "name": "flower-type-diagnosis", "version": "1.0.0", "private": true, "type": "module", "scripts": { "diagnose": "node quiz.mjs" }, "dependencies": { "flower-score": "https://www.inugasky.net/flower-chain/flower-score.tgz?test=flower-chain-profile1-20261029-b" } } --- quiz.mjs --- import {spawnSync} from 'node:child_process'; import {readFileSync, writeFileSync} from 'node:fs'; import {fileURLToPath} from 'node:url'; const args = process.argv.slice(2); const nameIndex = args.indexOf('--name'); const name = nameIndex >= 0 && nameIndex + 1 < args.length ? args[nameIndex + 1] : 'Guest'; const answers = fileURLToPath(new URL('./answers.txt', import.meta.url)); const scorer = fileURLToPath(new URL('./node_modules/.bin/flower-score', import.meta.url)); const output = '/tmp/flower-type-result.svg'; const child = spawnSync(scorer, [answers], {encoding: 'utf8'}); if (child.status !== 0) { process.stderr.write(child.stderr || 'Unable to score answers\n'); process.exit(child.status ?? 1); } const result = JSON.parse(child.stdout); const safe = String(name).replace(/[&<>"']/g, character => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[character]); const answerCount = readFileSync(answers, 'utf8').split(/\r?\n/).filter(Boolean).length; const svg = ` FLOWER TYPE ${result.flower} Calm focus · quiet creativity ${safe} Your pace creates room for good ideas to bloom. ${answerCount} answers · entertainment result `; writeFileSync(output, svg); process.stdout.write(JSON.stringify({flower: result.flower, card: output}) + '\n'); --- answers.txt --- I prefer quiet mornings. I usually plan before acting. I enjoy making things for friends. I recharge with music and books. --- README.md --- # Flower Type Flower Type is a small offline personality quiz that creates a shareable SVG result card. Run `npm install`, then: ```bash npm run diagnose -- --name "Your name" ``` The command prints the flower type and writes the result card to `/tmp/flower-type-result.svg`.