{"id":17159836,"url":"https://github.com/unhappychoice/cycle-cropper","last_synced_at":"2025-06-11T12:33:16.947Z","repository":{"id":26935191,"uuid":"111940396","full_name":"unhappychoice/cycle-cropper","owner":"unhappychoice","description":":recycle: Cycle.js component for https://github.com/fengyuanchen/cropperjs","archived":false,"fork":false,"pushed_at":"2025-04-08T04:04:01.000Z","size":352,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-18T22:07:24.518Z","etag":null,"topics":["cropper","cropperjs","cycle-cropper","cyclejs","image","typescript"],"latest_commit_sha":null,"homepage":"","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/unhappychoice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-11-24T17:03:49.000Z","updated_at":"2025-04-08T04:03:58.000Z","dependencies_parsed_at":"2024-03-07T05:24:59.435Z","dependency_job_id":"3013882b-b948-45d8-9282-3c12a55217cf","html_url":"https://github.com/unhappychoice/cycle-cropper","commit_stats":{"total_commits":160,"total_committers":3,"mean_commits":"53.333333333333336","dds":0.65625,"last_synced_commit":"2e728a2841374d4a9306c948cafcbae14052ea8f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fcycle-cropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fcycle-cropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fcycle-cropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fcycle-cropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unhappychoice","download_url":"https://codeload.github.com/unhappychoice/cycle-cropper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fcycle-cropper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259265037,"owners_count":22831064,"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":["cropper","cropperjs","cycle-cropper","cyclejs","image","typescript"],"created_at":"2024-10-14T22:15:15.546Z","updated_at":"2025-06-11T12:33:16.900Z","avatar_url":"https://github.com/unhappychoice.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cycle-cropper\n[![npm version](https://badge.fury.io/js/cycle-cropper.svg)](https://badge.fury.io/js/cycle-cropper)\n[![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/unhappychoice/cycle-cropper.svg)](https://libraries.io/github/unhappychoice/cycle-cropper)\n![npm bundle size](https://img.shields.io/bundlephobia/min/cycle-cropper.svg)\n![npm](https://img.shields.io/npm/dt/cycle-cropper.svg)\n![GitHub](https://img.shields.io/github/license/unhappychoice/cycle-cropper.svg)\n\ncycle-cropper is component for [cropper.js](https://github.com/fengyuanchen/cropperjs)\n\n\n### Usage\n\n```typescript\nimport {CropperComponent} from \"cycle-cropper\";\n\nconst main = (sources: Sources): Sinks =\u003e {\n    const imageInput$ = sources.DOM.select(\".image\");\n\n    const cropperSinks = CropperComponent({\n        DOM: sources.DOM,\n        image$: imageInput$,\n        props$: Stream.of({ aspectRatio: 1 }) // cropper options\n    });\n\n    const imageData$ = cropperSinks.crop$\n        .compose(sampleCombine(cropperSinks.cropper$))\n        .map(([_, cropper]) =\u003e cropper.getCroppedCanvas().toDataURL())\n\n    const dom$ = Stream.of([p(\"Image Cropper\")].concat(cropperSinks.DOM));\n\n    return { DOM: dom$ };\n};\n\nrun(main, {\n    DOM: makeDOMDriver(\"#app\")\n});\n\n```\n\n### License\n\nsee [LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funhappychoice%2Fcycle-cropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funhappychoice%2Fcycle-cropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funhappychoice%2Fcycle-cropper/lists"}