{"id":15152806,"url":"https://github.com/simonwep/yuppee","last_synced_at":"2025-10-24T09:30:33.029Z","repository":{"id":65281406,"uuid":"581588125","full_name":"simonwep/yuppee","owner":"simonwep","description":"⚙️ Type-safe migration library to migrate data from one schema to another.","archived":false,"fork":false,"pushed_at":"2023-01-24T13:22:17.000Z","size":136,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T22:56:37.325Z","etag":null,"topics":["json","migration","migration-tool"],"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/simonwep.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}},"created_at":"2022-12-23T16:30:45.000Z","updated_at":"2024-04-13T05:38:16.000Z","dependencies_parsed_at":"2023-02-13T21:46:09.393Z","dependency_job_id":null,"html_url":"https://github.com/simonwep/yuppee","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwep%2Fyuppee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwep%2Fyuppee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwep%2Fyuppee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwep%2Fyuppee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonwep","download_url":"https://codeload.github.com/simonwep/yuppee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237944079,"owners_count":19391588,"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":["json","migration","migration-tool"],"created_at":"2024-09-26T16:40:19.300Z","updated_at":"2025-10-24T09:30:32.668Z","avatar_url":"https://github.com/simonwep.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Simonwep","https://www.buymeacoffee.com/aVc3krbXQ"],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\n\u003ch3 align=\"center\"\u003e\n    Type-Safe migration utility to migrate from one data-schema to another.\n\u003c/h3\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://choosealicense.com/licenses/mit/\"\u003e\u003cimg\n        alt=\"License MIT\"\n        src=\"https://img.shields.io/badge/license-MIT-ae15cc.svg\"\u003e\u003c/a\u003e\n    \u003cimg alt=\"No dependencies\"\n        src=\"https://img.shields.io/badge/dependencies-none-8115cc.svg\"\u003e\n    \u003ca href=\"https://github.com/sponsors/Simonwep\"\u003e\u003cimg\n        alt=\"Support me\"\n        src=\"https://img.shields.io/badge/github-support-6a15cc.svg\"\u003e\u003c/a\u003e\n    \u003cimg alt=\"version\" src=\"https://img.shields.io/npm/v/yuppee?color=%233d24c9\u0026label=version\"\u003e\n    \u003ca href=\"https://www.buymeacoffee.com/aVc3krbXQ\"\u003e\u003cimg\n        alt=\"Buy me a coffee\"\n        src=\"https://img.shields.io/badge/%F0%9F%8D%BA-buy%20me%20a%20beer-%23FFDD00\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Simonwep/yuppee/actions?query=workflow%3ACI\"\u003e\u003cimg\n        alt=\"Build Status\"\n        src=\"https://github.com/Simonwep/yuppee/actions/workflows/main.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003cimg alt=\"gzip size\" src=\"https://img.badgesize.io/https://cdn.jsdelivr.net/npm/yuppee?compression=gzip\"\u003e\n    \u003cimg alt=\"brotli size\" src=\"https://img.badgesize.io/https://cdn.jsdelivr.net/npm/yuppee?compression=brotli\"\u003e\n\u003c/p\u003e\n\n### Summary\n\nThis is a small package to facilitate the transition from one data-structure to another.\nIt may be useful if you have settings or very little state that is stored as a single JSON-Object that needs to be migrated to another schema at some point.\n\n### Usage\n\nInstall it using your preferred package manager (taking npm as example):\n\n```shell\nnpm install yuppee\n```\n\n```ts\nimport { createMigration, createMigrator } from 'yuppee';\n\n// All possible versions your clients may have.\ntype StateV1 = { version: 1, name?: string };\ntype StateV2 = { version: 2, names: string[] };\ntype StateV3 = { version: 3, data: { names: string[] } };\n\n// This is the type that should be used throughout your app.\n// It's an alias to the latest version and can be re-mapped on every update.\ntype State = StateV3;\n\nconst migrate = createMigrator\u003cState, StateV1 | StateV2\u003e({\n    init: () =\u003e ({ name: 'baz' }),\n    migrations: [\n        createMigration\u003cStateV1, StateV2\u003e({\n            from: 1,\n            to: 2,\n            migrate: (state) =\u003e ({\n                names: state.name ? [state.name] : []\n            })\n        }),\n        createMigration\u003cStateV2, StateV3\u003e({\n            from: 2,\n            to: 3,\n            migrate: (state) =\u003e ({\n                data: { names: state.names }\n            })\n        })\n    ]\n});\n\n/* Logs { version: 3, data: { names: ['baz'] } } */\nconsole.log(migrate());\n\n/* Logs { version: 3, data: { names: ['foo'] } } */\nconsole.log(migrate({ version: 1, name: 'foo' }));\n\n/* Logs { version: 3, data: { names: ['bar', 'bam'] } } */\nconsole.log(migrate({ version: 2, names: ['bar', 'bam'] }));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwep%2Fyuppee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonwep%2Fyuppee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwep%2Fyuppee/lists"}