{"id":19551372,"url":"https://github.com/leafyeexyz/psychsheet","last_synced_at":"2025-08-04T09:32:43.508Z","repository":{"id":261731331,"uuid":"885168204","full_name":"LeafYeeXYZ/PsychSheet","owner":"LeafYeeXYZ","description":"Read and write data files in Browsers and Node/Deno/Bun. Support sav, dta, parquet, xlsx, json, csv, numbers, etc.","archived":false,"fork":false,"pushed_at":"2025-02-21T02:48:28.000Z","size":610,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T03:13:17.638Z","etag":null,"topics":["data-science","deno","file-format","javascript","jsr","psychology","statistics","typescript"],"latest_commit_sha":null,"homepage":"https://jsr.io/@psych/sheet","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeafYeeXYZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-08T04:45:05.000Z","updated_at":"2025-03-30T12:21:41.000Z","dependencies_parsed_at":"2025-01-08T20:22:48.747Z","dependency_job_id":"807174b9-534c-4e79-b8c0-38a1b85929ea","html_url":"https://github.com/LeafYeeXYZ/PsychSheet","commit_stats":null,"previous_names":["leafyeexyz/psychsheet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeafYeeXYZ/PsychSheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FPsychSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FPsychSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FPsychSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FPsychSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeafYeeXYZ","download_url":"https://codeload.github.com/LeafYeeXYZ/PsychSheet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FPsychSheet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268675515,"owners_count":24288285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"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":["data-science","deno","file-format","javascript","jsr","psychology","statistics","typescript"],"created_at":"2024-11-11T04:13:41.407Z","updated_at":"2025-08-04T09:32:43.461Z","avatar_url":"https://github.com/LeafYeeXYZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n[![JSR Version](https://jsr.io/badges/@psych/sheet)](https://jsr.io/@psych/sheet) [![JSR Scope](https://jsr.io/badges/@psych)](https://jsr.io/@psych) [![JSR Score](https://jsr.io/badges/@psych/sheet/score)](https://jsr.io/@psych/sheet/score)\n\n**PsychSheet** is a TypeScript library for parsing any data files into a universal format. It can be used to parse `.csv`, `.xlsx`, `.sav`, `.parquet`, `.dta`, `.numbers`, etc., into a json object array. And export the data to `.csv`, `.xlsx`, `.numbers`, etc.\n\n- PsychSheet can be used in all modern JavaScript/TypeScript environments, including browsers, Node.js, Deno, and Bun.\n- PsychSheet mainly based on [SheetJS](https://sheetjs.com/), but added more file formats for psychological and educational research.\n- For use cases, please refer to my another project [PsychPen](https://github.com/LeafYeeXYZ/PsychPen).\n\n**For full documentation and supported file formats, see \u003chttps://jsr.io/@psych/sheet/doc\u003e.**\n\n- [Introduction](#introduction)\n- [Qiuck Start](#qiuck-start)\n  - [Installation](#installation)\n  - [Use in Browser](#use-in-browser)\n  - [Use in Deno/Node/Bun](#use-in-denonodebun)\n- [Development](#development)\n\n# Qiuck Start\n\n## Installation\n\n```bash\nnpx jsr add @psych/sheet # if using npm\nbunx jsr add @psych/sheet # if using bun\ndeno add jsr:@psych/sheet # if using deno\npnpm dlx jsr add @psych/sheet # if using pnpm\nyarn dlx jsr add @psych/sheet # if using yarn\n```\n\n## Use in Browser\n\n```typescript\nimport { importSheet, downloadSheet } from '@psych/sheet'\nconst file = document.getElementById('file')\nfile.addEventListener('change', async () =\u003e {\n  const data = await importSheet(await file.files[0].arrayBuffer(), 'xlsx')\n  console.log(data[0], data.length)\n  downloadSheet(data, 'csv', 'example')\n})\n```\n\n## Use in Deno/Node/Bun\n\n```typescript\nimport { importSheet, exportSheet } from '@psych/sheet'\nimport { readFile, writeFile } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nconst filepath = resolve(import.meta.dirname!, 'example.xlsx')\nconst file = await readFile(filepath)\nconst data = await importSheet(file, 'xlsx')\nconsole.log(data[0], data.length)\nawait writeFile(resolve(import.meta.dirname!, 'example.csv'), exportSheet(data, 'csv'))\n```\n\n**For full documentation and supported file formats, see \u003chttps://jsr.io/@psych/sheet/doc\u003e.**\n\n# Development\n\n- `parquet` file format is supported by \u003chttps://github.com/hyparam/hyparquet\u003e.\n- `sav` file format is supported by \u003chttps://github.com/mhermher/savvy\u003e. But it doesn't run in the Browser originally `can not found 'global' error`, so I have to modify the source code to make it work. You can find the source code in the `/lib/sav` folder.\n- `dta`、`xlsx`、`numbers` file formats are supported by \u003chttps://sheetjs.com/\u003e. But `JSR` doesn't support importing modules from third-party URLs, so I have to download the source code and import them locally. You can find the source code in the `/lib/xlsx` folder.\n\nIf you haven't installed `deno` yet, please install it referring to the \u003chttps://deno.com\u003e. Then, clone this repository.\n\n```bash\ngit clone https://github.com/LeafYeeXYZ/PsychSheet.git\n```\n\nNow you can write `TypeScript` code in `/lib/**/*.ts` and export functions in `/lib/index.ts`. Note that you should not import base functions from `/lib/index.ts` to avoid circular dependencies.\n\nAfter writing the code, remember to add test cases in `/tests/*.test.ts`. You can run the test cases using the following command.\n\n```bash\ndeno test -A\n```\n\nThis project publishes to \u003chttps://jsr.io\u003e, so you don't need to compile the code to JavaScript. And you also don't need to publish the package manually. Just modify `deno.json` and push the code to the repository. The `GitHub Action` will do the rest for you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafyeexyz%2Fpsychsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafyeexyz%2Fpsychsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafyeexyz%2Fpsychsheet/lists"}