{"id":20016941,"url":"https://github.com/freesewing/pattern-via-io","last_synced_at":"2026-06-09T19:31:34.812Z","repository":{"id":173146670,"uuid":"650291652","full_name":"freesewing/pattern-via-io","owner":"freesewing","description":"An example of a stdin -\u003e freesewing -\u003e stdout pipeline","archived":false,"fork":false,"pushed_at":"2024-03-15T07:15:45.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-02T03:14:54.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freesewing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-06-06T18:56:34.000Z","updated_at":"2024-11-26T13:14:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"6efd0b62-0f8f-43e9-bf9d-022eef818da5","html_url":"https://github.com/freesewing/pattern-via-io","commit_stats":null,"previous_names":["freesewing/pattern-via-io"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/freesewing/pattern-via-io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesewing%2Fpattern-via-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesewing%2Fpattern-via-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesewing%2Fpattern-via-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesewing%2Fpattern-via-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freesewing","download_url":"https://codeload.github.com/freesewing/pattern-via-io/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesewing%2Fpattern-via-io/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34123171,"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-09T02:00:06.510Z","response_time":63,"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":"2024-11-13T08:13:50.766Z","updated_at":"2026-06-09T19:31:34.789Z","avatar_url":"https://github.com/freesewing.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example of a STDIN → FreeSewing → STDOUT pipeline\n\nThis repository was setup to answer this question (paraphrased):\n\n\u003e I am a Python dev. How can I use FreeSewing when I have a bunch of settings and all I want is an SVG?\n\nTo use FreeSewing in a different environment, there are various technical solutions, but the simplest approach is to push your settings as JSON to the `stdin` of a NodeJS script that will then read the settings from `stdin`, parse them as JSON, generate the pattern, and then dump the resulting SVG to `stdout`.\n\nThis repo holds an example of how to do that (in `src/index.mjs`) and some further instructions below.\n\n## Getting started\n\nTo try this at home, you will need NodeJS on your system.\nAssuming you do, you can clone this repository, cd into it, and install dependencies.\n\n```sh\ngit clone git@github.com:freesewing/pattern-via-io.git\ncd pattern-via-io\nnpm install\n```\n\nOnce the dependencies are installed you can run this to try it:\n\n```\ncat example-settings.json | node generate-pattern.mjs\n```\n\nOr to save it to a file:\n\n```\ncat example-settings.json | node generate-pattern.mjs \u003e pattern.svg\n```\n\nYou can find the `pattern.svg` generated by the example above in this repository.\n\n## Using a different design\n\nThis example uses `@freesewing/aaron` which extends `@freesewing/brian`.\nIf you want to use a different design (for example simon) you should install it:\n\n```\nnpm i --save @freesewing/simon@next\n```\n\nAnd then change the import in the script.\n\n\u003e **Note:** The `@next` suffix is required until v3 is in GA.\n\n## Accessing pattern data, rather then generating an SVG\n\nIf you want to interact with the resulting pattern in programmatic way --\nrather than just get the SVG -- you can run this:\n\n```\ncat example-settings.json | node generate-json.mjs\n```\n\nIt will dump (by default) the parts as JSON, which contain all parts with their points and paths.\nHowever, you can access any pattern data by adapting the `generate-json.mjs` example.\n\nThe relevant lines are:\n\n```mjs\nconst data = pattern.getRenderProps()\nconsole.log(JSON.stringify(data.parts, null, 2))\n```\n\n## Questions?\n\nJoin us on Discord at [discord.freesewing.org](https://discord.freesewing.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesewing%2Fpattern-via-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreesewing%2Fpattern-via-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesewing%2Fpattern-via-io/lists"}