{"id":18735700,"url":"https://github.com/rdmurphy/deno-quaff","last_synced_at":"2026-05-05T13:42:35.127Z","repository":{"id":142041705,"uuid":"608497452","full_name":"rdmurphy/deno-quaff","owner":"rdmurphy","description":"A port of the quaff Node.js library to Deno.","archived":false,"fork":false,"pushed_at":"2023-03-02T07:09:38.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-28T16:43:10.457Z","etag":null,"topics":["archieml","csv","data","deno","json","toml","yaml"],"latest_commit_sha":null,"homepage":"https://deno.land/x/quaff","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdmurphy.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}},"created_at":"2023-03-02T06:15:03.000Z","updated_at":"2023-03-02T07:22:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a86753b-f2cc-4f03-aba0-e975ed0309eb","html_url":"https://github.com/rdmurphy/deno-quaff","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fdeno-quaff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fdeno-quaff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fdeno-quaff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fdeno-quaff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdmurphy","download_url":"https://codeload.github.com/rdmurphy/deno-quaff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239611986,"owners_count":19668272,"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","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":["archieml","csv","data","deno","json","toml","yaml"],"created_at":"2024-11-07T15:17:47.717Z","updated_at":"2025-11-16T07:30:17.068Z","avatar_url":"https://github.com/rdmurphy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/yC80ftQ.png\" width=\"150\" height=\"217\" alt=\"quaff\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n  quaff\n\u003c/h1\u003e\n\nA port of the [`quaff` Node.js library](https://github.com/rdmurphy/quaff) to\nDeno. Mostly done as an experiment to see how easy it would be, but it's also\nfully tested and adds support for [TOML](https://toml.io/en/)! 🎉\n\n## Key features\n\n- 🚚 A **data pipeline helper** that works similar to\n  [Middleman](https://middlemanapp.com/)'s\n  [Data Files](https://middlemanapp.com/advanced/data_files/) collector\n- 📦 Point the library at a folder filled with JS, AML\n  ([ArchieML](http://archieml.org)), JSON, YAML, CSV, TSV and/or TOML files and\n  **get a JavaScript object back that reflects the folder's structure and\n  content/exports**\n\n## Usage\n\nAssume a folder with this structure.\n\n```txt\ndata/\n  mammals/\n    cats.json\n    dogs.json\n    bears.csv\n  birds/\n    parrots.yml\n    story.aml\n```\n\nAfter `import`'ing `quaff`:\n\n```ts\nimport { load } from \"https://deno.land/x/quaff/mod.ts\";\n\nconst data = await load(\"./data/\");\nconsole.log(data);\n```\n\nAnd the results...\n\n```json\n{\n  \"mammals\": {\n    \"cats\": [\"Marty\", \"Sammy\"],\n    \"dogs\": [\"Snazzy\", \"Cally\"],\n    \"bears\": [\n      {\n        \"name\": \"Steve\",\n        \"type\": \"Polar bear\"\n      },\n      {\n        \"name\": \"Angelica\",\n        \"type\": \"Sun bear\"\n      }\n    ]\n  },\n  \"birds\": {\n    \"parrots\": {\n      \"alive\": [\"Buzz\"],\n      \"dead\": [\"Moose\"]\n    },\n    \"story\": {\n      \"title\": \"All about birds\",\n      \"prose\": [\n        { \"type\": \"text\", \"value\": \"Do you know how great birds are?\" },\n        { \"type\": \"text\", \"value\": \"Come with me on this journey.\" }\n      ]\n    }\n  }\n}\n```\n\nIt's also possible to load a single file at a time, allowing more custom\napproaches in case `load` doesn't work exactly the way you'd like.\n\n```ts\nimport { loadFile } from \"https://deno.land/x/quaff/mod.ts\";\n\nconst data = await loadFile(\"./data/mammals/bears.csv\");\nconsole.log(data);\n```\n\nAnd the results...\n\n```json\n[\n  {\n    \"name\": \"Steve\",\n    \"type\": \"Polar bear\"\n  },\n  {\n    \"name\": \"Angelica\",\n    \"type\": \"Sun bear\"\n  }\n]\n```\n\n## Advanced Usage with JavaScript files\n\n`quaff` has the ability to load JavaScript files. But how exactly does that\nwork?\n\nJavaScript files that are consumed by `quaff` have to follow one simple rule -\nthey must `export default` a function, an async function or value. All three of\nthese are valid and return the same value:\n\n```js\nexport default [\n  {\n    name: \"Pudge\",\n    instagram: \"https://instagram.com/pudgethecorgi/\",\n  },\n];\n```\n\n```js\nexport default () =\u003e [\n  {\n    name: \"Pudge\",\n    instagram: \"https://instagram.com/pudgethecorgi/\",\n  },\n];\n```\n\n```js\nexport default async () =\u003e [\n  {\n    name: \"Pudge\",\n    instagram: \"https://instagram.com/pudgethecorgi/\",\n  },\n];\n```\n\nThe final example above is the most interesting one - `async` functions also\nwork! This means you can write code to hit API endpoints, or do other\nasynchronous work, and `quaff` will wait for those to resolve.\n\n```js\nexport default async () =\u003e {\n  const res = await fetch(\"https://my-cool-api/\");\n  const data = await res.json();\n\n  // whatever the API returned will be added to the quaff object!\n  return data;\n};\n```\n\nDon't have a `Promise` to do async work with? Working with a callback interface?\nJust wrap it in one!\n\n```js\nimport { apiHelper } from \"npm:my-callback-api\";\n\nexport default () =\u003e {\n  return new Promise((resolve, reject) =\u003e {\n    apiHelper(\"people\", (err, data) =\u003e {\n      if (err) return reject(err);\n\n      // quaff will take it from here!\n      resolve(data);\n    });\n  });\n};\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdmurphy%2Fdeno-quaff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdmurphy%2Fdeno-quaff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdmurphy%2Fdeno-quaff/lists"}