{"id":26407290,"url":"https://github.com/yuqingc/power-transaction","last_synced_at":"2025-07-03T02:05:44.616Z","repository":{"id":57329102,"uuid":"181864713","full_name":"yuqingc/power-transaction","owner":"yuqingc","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-22T01:47:36.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T02:05:36.233Z","etag":null,"topics":["transaction","transaction-processing","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuqingc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.996ICU","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-17T09:58:54.000Z","updated_at":"2019-04-22T01:47:37.000Z","dependencies_parsed_at":"2022-09-01T11:41:48.874Z","dependency_job_id":null,"html_url":"https://github.com/yuqingc/power-transaction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yuqingc/power-transaction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuqingc%2Fpower-transaction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuqingc%2Fpower-transaction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuqingc%2Fpower-transaction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuqingc%2Fpower-transaction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuqingc","download_url":"https://codeload.github.com/yuqingc/power-transaction/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuqingc%2Fpower-transaction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263245316,"owners_count":23436513,"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":["transaction","transaction-processing","typescript"],"created_at":"2025-03-17T17:29:43.346Z","updated_at":"2025-07-03T02:05:44.593Z","avatar_url":"https://github.com/yuqingc.png","language":"TypeScript","readme":"# Power Transaction\n\n[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)\n[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)\n[![npm version](https://img.shields.io/npm/v/power-transaction.svg?style=flat)](https://www.npmjs.com/package/power-transaction)\n[![github issues](https://img.shields.io/github/issues/yuqingc/power-transaction.svg?style=flat)](https://github.com/yuqingc/power-transaction/issues)\n\n**DO NOT USE IT AT PRESENT!**\n\nPower Transaction is a tool for handling transactions. Still under development. *NOT* stable.\n\n## Get Started\n\n### Installation\n\n```\n$ yarn add power-transaction\n```\nor with NPM\n\n```\n$ npm i --save power-transaction\n```\n\n### Code\n\n```ts\nimport { createTransaction, TransactionConfig } from '../src'\n\n\nconst config: TransactionConfig = {\n  tasks: [\n    {\n      name: 'step1',\n      action: (data: any) =\u003e {\n        console.log('executing step1', data);\n        return 'step1 return';\n      },\n      rollback: (data: any) =\u003e {\n        console.log('rolling back step1');\n      }\n    },\n    {\n      name: 'step2',\n      action: (data: any) =\u003e {\n        console.log('executing step2', data);\n        return 'step2 return';\n      },\n      rollback: (data: any) =\u003e {\n        console.log('rolling back step2');\n      }\n    },\n    {\n      name: 'step3',\n      action: (data: any) =\u003e {\n        console.log('executing step3', data);\n        return 'step3 return';\n      },\n      rollback: (data: any) =\u003e {\n        console.log('rolling back step3');\n      }\n    },\n    {\n      name: 'step4',\n      action: (data: any) =\u003e {\n        console.log('executing step4', data);\n        return 'step1 return';\n      },\n      rollback: (data: any) =\u003e {\n        console.log('rolling back step4');\n      }\n    }\n  ],\n}\n\nconst t = createTransaction(config)\nt.executeAll();\n```\n\n## Development\n\n```\n$ yarn build\n$ yarn test\n```\n\n## License\n\nUnder [MIT license](https://github.com/yuqingc/power-transaction/blob/master/LICENSE.MIT) with [Anti-996 license](https://github.com/yuqingc/power-transaction/blob/master/LICENSE.996ICU).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuqingc%2Fpower-transaction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuqingc%2Fpower-transaction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuqingc%2Fpower-transaction/lists"}