{"id":50841019,"url":"https://github.com/tetherto/pearpass-lib-data-export","last_synced_at":"2026-06-14T06:35:12.008Z","repository":{"id":358618118,"uuid":"1113288252","full_name":"tetherto/pearpass-lib-data-export","owner":"tetherto","description":"PearPass is an open-source, privacy-first password manager with peer-to-peer syncing and end-to-end encryption. This repository contains shared core components used across the PearPass apps.","archived":false,"fork":false,"pushed_at":"2026-05-28T09:39:11.000Z","size":189,"stargazers_count":0,"open_issues_count":0,"forks_count":9,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T11:18:40.106Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pass.pears.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.md","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-09T19:14:52.000Z","updated_at":"2026-05-28T09:39:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/pearpass-lib-data-export","commit_stats":null,"previous_names":["tetherto/pearpass-lib-data-export"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/pearpass-lib-data-export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-data-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-data-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-data-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-data-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/pearpass-lib-data-export/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-data-export/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34312072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-14T06:35:11.208Z","updated_at":"2026-06-14T06:35:12.004Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pearpass-lib-data-export\n\nA utility for exporting PearPass vaults to various formats.\n\n## Features\n\n- Export vault records to CSV or JSON format.\n- Export 2FA/OTP credentials to CSV, JSON, or individual QR-code SVG files.\n- OTP exports include full `otpauth://` URIs for round-trip import into authenticator apps.\n\n## Security Notice\n\n1. To ensure the security and integrity of your projects, please note that official PearPass packages are distributed exclusively through our GitHub organization.\n2. Any packages with similar names found on the npm registry or other third-party package managers are not affiliated with PearPass and should be strictly avoided. We recommend installing directly from this repository to ensure you are using the verified, open-source version.\n\n## Installation\n\nInstall the package using npm:\n\n```bash\nnpm install git+https://github.com/tetherto/pearpass-lib-data-export.git\n```\n\n## Testing\n\nTo run the tests, use the following command:\n\n```bash\nnpm test\n```\n\n## Usage Examples\n\nHere's how you can use the library to export data:\n\n### Export to JSON\n\n```javascript\nimport { parseDataToJson } from '@tetherto/pearpass-lib-data-export';\n\nconst vaultData = [\n  {\n    name: 'My Vault',\n    records: [\n      {\n        type: 'login',\n        data: {\n          title: 'Sample Login',\n          username: 'user',\n          password: 'password123'\n        }\n      }\n    ]\n  }\n];\n\nconst files = parseDataToJson(vaultData);\nfiles.forEach(file =\u003e {\n  console.log(`File: ${file.filename}`);\n  // You can now save file.data to a file\n});\n```\n\n### Export to CSV\n\n```javascript\nimport { parseDataToCsvText } from '@tetherto/pearpass-lib-data-export';\n\nconst vaultData = [\n  {\n    name: 'My Vault',\n    records: [\n      {\n        type: 'login',\n        data: {\n          title: 'Sample Login',\n          username: 'user',\n          password: 'password123'\n        }\n      }\n    ]\n  }\n];\n\nconst files = parseDataToCsvText(vaultData);\nfiles.forEach(file =\u003e {\n  console.log(`File: ${file.filename}`);\n  // You can now save file.data to a file\n});\n```\n\n### Export OTP credentials to JSON\n\n```javascript\nimport { parseOtpToJson } from '@tetherto/pearpass-lib-data-export';\n\nconst files = parseOtpToJson(vaultData);\n// =\u003e [{ filename: 'PearPass_2FA_2024_01_01T00_00_00_000Z.json', data: '...' }]\n```\n\nEach record in the JSON output contains: `vaultName`, `title`, `issuer`, `label`, `secret`, `type` (`TOTP`/`HOTP`), `algorithm`, `digits`, `period` (TOTP), `counter` (HOTP), and `otpauthUri`.\n\n### Export OTP credentials to CSV\n\n```javascript\nimport { parseOtpToCsvText } from '@tetherto/pearpass-lib-data-export';\n\nconst files = parseOtpToCsvText(vaultData);\n// =\u003e [{ filename: 'PearPass_2FA_2024_01_01T00_00_00_000Z.csv', data: '...' }]\n```\n\nColumns: `vaultName`, `title`, `issuer`, `label`, `secret`, `type`, `algorithm`, `digits`, `period`, `counter`, `otpauthUri`.\n\n### Export OTP credentials as QR-code SVGs\n\n```javascript\nimport { parseOtpToQrSvgs } from '@tetherto/pearpass-lib-data-export';\n\nconst files = await parseOtpToQrSvgs(vaultData);\n// =\u003e [{ filename: 'GitHub_user@example.com.svg', data: '\u003csvg\u003e...\u003c/svg\u003e' }, ...]\n```\n\nEach SVG encodes the `otpauth://` URI for that credential. Filenames are derived from the issuer and label, with deduplication suffixes when needed.\n\n## API Reference\n\nAll functions accept the same `vaultData` shape:\n\n```javascript\n[\n  {\n    name: 'Vault Name',       // string\n    records: [\n      {\n        type: 'login',        // record type\n        data: {\n          title: 'GitHub',\n          username: 'user',\n          password: 'secret',\n          otp: {              // optional — only for 2FA records\n            type: 'TOTP',     // 'TOTP' | 'HOTP'\n            secret: 'BASE32SECRET',\n            issuer: 'GitHub',\n            label: 'user@example.com',\n            algorithm: 'SHA1',\n            digits: 6,\n            period: 30        // TOTP only\n          }\n        }\n      }\n    ]\n  }\n]\n```\n\n| Function | Return type | Description |\n|----------|-------------|-------------|\n| `parseDataToJson(data)` | `Array\u003c{filename, data}\u003e` | Exports all vault records as JSON |\n| `parseDataToCsvText(data)` | `Array\u003c{filename, data}\u003e` | Exports all vault records as CSV |\n| `parseOtpToJson(data)` | `Array\u003c{filename, data}\u003e` | Exports OTP credentials as JSON |\n| `parseOtpToCsvText(data)` | `Array\u003c{filename, data}\u003e` | Exports OTP credentials as CSV |\n| `parseOtpToQrSvgs(data)` | `Promise\u003cArray\u003c{filename, data}\u003e\u003e` | Exports one SVG QR code per OTP credential |\n\nAll functions return (or resolve to) an array of file objects. Write each `file.data` to `file.filename` to save the export.\n\n## Related Projects\n\n*   [@tetherto/pearpass-lib-data-import](https://github.com/tetherto/pearpass-lib-data-import)\n\n## License\n\nThis project is licensed under the Apache License, Version 2.0. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpearpass-lib-data-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fpearpass-lib-data-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpearpass-lib-data-export/lists"}