{"_id":"@yotoplay/twee2json","_rev":"30-a0868a94e03d900f446a1699e7d55091","name":"@yotoplay/twee2json","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@yotoplay/twee2json","version":"1.0.0","keywords":["twine","twee","json","converter","interactive-fiction"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2json@1.0.0","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"}],"homepage":"https://github.com/yotoplay/twee2json#readme","bugs":{"url":"https://github.com/yotoplay/twee2json/issues"},"dist":{"shasum":"74f12d9471aede2d9e4f4554edf4c1ec93eb7ee4","tarball":"https://registry.npmjs.org/@yotoplay/twee2json/-/twee2json-1.0.0.tgz","fileCount":12,"integrity":"sha512-bxxElbAbsKddPhu4MwwocbBMZ8XQtn1ZPoKskORzOWhFojTZ7bWSSUAEQbmk/2iZmKdURdA7rD7tWCQTSi/Tkg==","signatures":[{"sig":"MEYCIQCPK6N7xvstzgLARy8mm5w1LrTDuXPPJBI7JiPn5UdqfwIhAKZE9uBh7VitCEU5LUtaAM2Z6dWQJU9IZdktaJ9lDQUN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":241956},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"032b6ac673f4388de42bc1fd64a36829c2e0aa2a","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc && npm run copy-test-data","format":"prettier --check .","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","copy-test-data":"cp -r __tests__/data dist/__tests__/","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","actor":{"name":"gregyoto","type":"user","email":"greg@yotoplay.com"},"email":"greg@yotoplay.com"},"prettier":"@yoto/prettier-config","repository":{"url":"git+https://github.com/yotoplay/twee2json.git","type":"git"},"_npmVersion":"10.9.2","description":"Convert Twine/Twee files to JSON format","directories":{},"_nodeVersion":"22.17.0","eslintConfig":{"extends":"@yoto/eslint-config"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2","@yoto/eslint-config":"bitbucket:yotoplay/yoto-config-eslint#semver:3.0.20","@yoto/prettier-config":"bitbucket:yotoplay/yoto-config-prettier#semver:2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/twee2json_1.0.0_1751475350825_0.16878610488951118","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@yotoplay/twee2json","version":"1.0.1","keywords":["twine","twee","json","converter","interactive-fiction"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2json@1.0.1","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"}],"homepage":"https://github.com/yotoplay/twee2json#readme","bugs":{"url":"https://github.com/yotoplay/twee2json/issues"},"dist":{"shasum":"906c340d0ae0d2380417e722c08ef529f21bd342","tarball":"https://registry.npmjs.org/@yotoplay/twee2json/-/twee2json-1.0.1.tgz","fileCount":12,"integrity":"sha512-gylMgQNJjlHWvZmgXHoVpLylX39et04bNqD56r3g500Qv7onxlpkuMCtO5Q7yRukUZ1DdkF9XPlZcyn1UyrWXw==","signatures":[{"sig":"MEUCIE+FA87aUAkfO4yHE52boF9JRITEc/xCGF619oVgdr6XAiEAs8chTjtiDkFJIVBhFt2iCH3P5x28g8jIc7RFce1gU4I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":241692},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1c5e1c72d5a3b11c1cd9f40269ba87cf47b5e4f4","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc && npm run copy-test-data","format":"prettier --check .","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","copy-test-data":"cp -r __tests__/data dist/__tests__/","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","actor":{"name":"gregyoto","type":"user","email":"greg@yotoplay.com"},"email":"greg@yotoplay.com"},"repository":{"url":"git+https://github.com/yotoplay/twee2json.git","type":"git"},"_npmVersion":"10.9.2","description":"Convert Twine/Twee files to JSON format","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2"},"_npmOperationalInternal":{"tmp":"tmp/twee2json_1.0.1_1751476089496_0.9731802936882257","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@yotoplay/twee2json","version":"1.0.2","keywords":["twine","twee","json","converter","interactive-fiction"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2json@1.0.2","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"},{"name":"tomhazledine","email":"tom@tomhazledine.com"}],"homepage":"https://github.com/yotoplay/twee2json#readme","bugs":{"url":"https://github.com/yotoplay/twee2json/issues"},"dist":{"shasum":"9077690c7dba258a8197ce5c256fd2e3c95b7749","tarball":"https://registry.npmjs.org/@yotoplay/twee2json/-/twee2json-1.0.2.tgz","fileCount":12,"integrity":"sha512-KJmbFNOVJnJ+3dI8FCkl+fYHdOeC+Zyv/n1jbSXwjBBAD8zz9qq/H9qgFOTaRIUKqkBn66ddCo8L6XC5+GHlrQ==","signatures":[{"sig":"MEQCICluSllqZu82n8xJ+dWWE1xpn9zWJ5hLsjSXrnuN7PchAiBbEq/KDLwOwsfxyTY06rebJIJvUVqdCI1hJP4XbRsDzA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":241972},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3a7fc5cb67635193b382b1cde5ae44808b4f2f8c","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc && npm run copy-test-data","format":"prettier --check .","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","copy-test-data":"cp -r __tests__/data dist/__tests__/","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","email":"greg@yotoplay.com"},"repository":{"url":"git+https://github.com/yotoplay/twee2json.git","type":"git"},"_npmVersion":"10.9.3","description":"Convert Twine/Twee files to JSON format","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.2","@semantic-release/github":"^11.0.3","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/release-notes-generator":"^14.0.3"},"_npmOperationalInternal":{"tmp":"tmp/twee2json_1.0.2_1753385580418_0.5975995093537125","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@yotoplay/twee2json","version":"1.1.0","keywords":["twine","twee","json","converter","interactive-fiction"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2json@1.1.0","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"},{"name":"tomhazledine","email":"tom@tomhazledine.com"}],"homepage":"https://github.com/yotoplay/twee2json#readme","bugs":{"url":"https://github.com/yotoplay/twee2json/issues"},"dist":{"shasum":"2afd63510a288477a7b9e1477229c4c36600df98","tarball":"https://registry.npmjs.org/@yotoplay/twee2json/-/twee2json-1.1.0.tgz","fileCount":12,"integrity":"sha512-rCy5H52g68oOBpQuQSQeP5sTn7q1eEUYgJ6NDDDquSQy4IjSIWhPrGD+d7TeyH815yzmzvxAcoKL3desKhwkHQ==","signatures":[{"sig":"MEQCIGBwq8M31K2uWy0+mVsTq3pSXiwBR7ZSR+RpK+kv3EbYAiA5ECja4hdr1KsBFMAYRxnKSW7j29UZZeA7Iq98se9mlA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@yotoplay%2ftwee2json@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":241972},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"58b98f411d21786cb9a53dec5fafcae010efe729","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc && npm run copy-test-data","format":"prettier --check .","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","copy-test-data":"cp -r __tests__/data dist/__tests__/","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","email":"greg@yotoplay.com"},"repository":{"url":"git+https://github.com/yotoplay/twee2json.git","type":"git"},"_npmVersion":"10.9.3","description":"Convert Twine/Twee files to JSON format","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.2","@semantic-release/github":"^11.0.3","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/release-notes-generator":"^14.0.3"},"_npmOperationalInternal":{"tmp":"tmp/twee2json_1.1.0_1753461407864_0.391212713197425","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-07-02T16:55:50.825Z","modified":"2026-08-18T09:46:04.564Z","1.0.0":"2025-07-02T16:55:51.000Z","1.0.1":"2025-07-02T17:08:09.686Z","1.0.2":"2025-07-24T19:33:00.634Z","1.1.0":"2025-07-25T16:36:48.171Z"},"bugs":{"url":"https://github.com/yotoplay/twee2json/issues"},"author":{"name":"Yoto"},"license":"MIT","homepage":"https://github.com/yotoplay/twee2json#readme","keywords":["twine","twee","json","converter","interactive-fiction"],"repository":{"url":"git+https://github.com/yotoplay/twee2json.git","type":"git"},"description":"Convert Twine/Twee files to JSON format","maintainers":[{"email":"dan@danwebb.net","name":"danwrong"},{"email":"rob.beal@yotoplay.com","name":"yoto-robbeal"},{"email":"asta.malyskaite@yotoplay.com","name":"aistyna"},{"email":"vincenzo.ciaccio@gmail.com","name":"vikkio88"},{"email":"eriks@yotoplay.com","name":"erixk"},{"email":"ralph@yotoplay.com","name":"yoto_ralph"},{"email":"hiroshi.sipahioglu@yotoplay.com","name":"hiro11"},{"email":"hasan.abdulgader@yotoplay.com","name":"hasan-yoto"},{"email":"adam.flitney@gmail.com","name":"adamflitney"},{"email":"jaimen.lathia@yotoplay.com","name":"jaimen-yoto"},{"email":"seb.sim@yotoplay.com","name":"seb.sim"},{"email":"caneycode@gmail.com","name":"escaney"},{"email":"tami.effendowicz@yotoplay.com","name":"tami.effendowicz"},{"email":"liam.sennitt@yotoplay.com","name":"liam-yoto"},{"email":"kieran.mozer@yotoplay.com","name":"kmoze"},{"email":"yusyuan.cheng@yotoplay.com","name":"yusyuan-yoto"},{"email":"Olliewarway@gmail.com","name":"owarway"},{"email":"onishiweb@gmail.com","name":"onishiweb"},{"email":"tash.mulla@yotoplay.com","name":"tash.mulla"},{"email":"filip@yotoplay.com","name":"filipyoto"},{"email":"sian.lynch@yotoplay.com","name":"sianyoto"},{"email":"luke.jeffery@yotoplay.com","name":"lukejeffery-yoto"},{"email":"security-integrations@yotoplay.com","name":"yoto-security-integrations"},{"email":"hello@alvin.codes","name":"alvinometric"},{"email":"emma.beynon@gmail.com","name":"emmabeynon"},{"email":"greg@yotoplay.com","name":"gregyoto"},{"email":"tom@tomhazledine.com","name":"tomhazledine"},{"email":"theresa.may@yotoplay.com","name":"theresa-yo"}],"readme":"# twee2json\n\nA TypeScript library for converting Twine/Twee files to JSON format.\n\n## Installation\n\n```bash\nnpm install twee2json\n```\n\n## Usage\n\n```typescript\nimport { convertTweeToJson } from \"twee2json\";\n\nconst tweeContent = `:: StoryTitle\nMy Story\n\n:: StoryData\n{\n    \"start\": \"Start\",\n    \"ifid\": \"12345678-1234-1234-1234-123456789012\"\n}\n\n:: Start\nThis is the start of the story.\n\n[[Go to next|Next]]\n\n:: Next\nThis is the next passage.\n\n[[Go back|Start]]`;\n\nconst result = convertTweeToJson(tweeContent);\nconsole.log(result);\n```\n\n## API\n\n### `convertTweeToJson(tweeContent: string): TweeJSON`\n\nConverts a Twee file content string to a structured JSON object.\n\n#### Parameters\n\n- `tweeContent` (string): The content of a Twee file\n\n#### Returns\n\nA `TweeJSON` object with the following structure:\n\n```typescript\ninterface TweeJSON {\n  metadata: Metadata;\n  variables: { [key: string]: any };\n  passages: Passage[];\n}\n```\n\n## Types\n\n### Metadata\n\n```typescript\ninterface Metadata {\n  title: string | undefined;\n  init: Init | null;\n  data?: StoryData | null;\n}\n```\n\n### Passage\n\n```typescript\ninterface Passage {\n  name: string;\n  metadata: Metadata | null;\n  content: string;\n  choices: Choice[];\n  comments?: string[];\n  variables?: { [key: string]: any };\n  tags?: string[];\n}\n```\n\n### Choice\n\n```typescript\ninterface Choice {\n  text: string;\n  link: string;\n}\n```\n\n## Features\n\n- Parses Twee file format\n- Extracts story metadata\n- Processes passages and their content\n- Handles choices and links\n- Extracts variables and datamaps\n- Processes tags and comments\n- Moves start node to the front of passages array\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\n\n# Build the package\nnpm run build\n\n# Lint code\nnpm run lint\n\n# Format code\nnpm run format:fix\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}