{"_id":"@agnosticeng/migrate","_rev":"1-e14753a71a5c3c3fe7b22c2b18367b3c","name":"@agnosticeng/migrate","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@agnosticeng/migrate","version":"0.0.1","_id":"@agnosticeng/migrate@0.0.1","maintainers":[{"name":"didierfranc","email":"mail@didierfranc.com"}],"homepage":"https://github.com/agnosticeng/migrate#readme","bugs":{"url":"https://github.com/agnosticeng/migrate/issues"},"dist":{"shasum":"5770ac0448cb226a809ad71539bd9024aa85ebfc","tarball":"https://registry.npmjs.org/@agnosticeng/migrate/-/migrate-0.0.1.tgz","fileCount":5,"integrity":"sha512-8+WFXUnBTKhJtlWfTu30Oy9LEqTKPWiUN5horwHRSjSrek9cC4FnfgrTyQNNfDUYc1cYbrLw2nDpQfCeiqfNDQ==","signatures":[{"sig":"MEUCIFjK/dOYO+oIK1WTMylKc5BEV8wJS088lHRlP0zY65tJAiEA94wQcoT+eqxbUlut1jZ/BcQyV4iCnuz2CszzkgJ7XJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7221},"main":"./dist/migrate.umd.cjs","type":"module","types":"./dist/migrate.d.ts","module":"./dist/migrate.js","exports":{".":{"import":"./dist/migrate.js","require":"./dist/migrate.cjs"}},"gitHead":"c0aed3ea862f67e582c7f7fa297d88785e7de2a0","scripts":{"dev":"vite","build":"vite build && tsc","preview":"vite preview","test:browser":"vitest"},"_npmUser":{"name":"didierfranc","email":"mail@didierfranc.com"},"repository":{"url":"git+https://github.com/agnosticeng/migrate.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight SQL migration manager for TypeScript/JavaScript applications.","directories":{},"_nodeVersion":"20.18.1","_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.3","jsdom":"^25.0.1","vitest":"^2.1.8","typescript":"~5.6.2","@types/node":"^22.10.2","webdriverio":"^9.5.1","@vitest/browser":"^2.1.8"},"_npmOperationalInternal":{"tmp":"tmp/migrate_0.0.1_1736179369864_0.890837870954732","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@agnosticeng/migrate","repository":{"type":"git","url":"git+https://github.com/agnosticeng/migrate.git"},"type":"module","scripts":{"dev":"vite","build":"vite build && tsc","preview":"vite preview","test:browser":"vitest"},"devDependencies":{"@types/node":"^22.10.2","@vitest/browser":"^2.1.8","jsdom":"^25.0.1","typescript":"~5.6.2","vite":"^6.0.3","vitest":"^2.1.8","webdriverio":"^9.5.1"},"main":"./dist/migrate.umd.cjs","types":"./dist/migrate.d.ts","module":"./dist/migrate.js","exports":{".":{"import":"./dist/migrate.js","require":"./dist/migrate.cjs"}},"version":"0.0.2","_id":"@agnosticeng/migrate@0.0.2","gitHead":"2dac05404902c9d10655affd4db762bc9281c226","description":"A lightweight SQL migration manager for TypeScript/JavaScript applications.","bugs":{"url":"https://github.com/agnosticeng/migrate/issues"},"homepage":"https://github.com/agnosticeng/migrate#readme","_nodeVersion":"20.18.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Whbl3Lyn3v+aDmpz/zYKP44tbey7KDeDh01kFNaYSwoZNrDc5/KlB9pr6QFntkrtGdH6lVmAT5Myvm6BqZncnw==","shasum":"1a139c0d243003a81c58a242b97d8c7aba5136af","tarball":"https://registry.npmjs.org/@agnosticeng/migrate/-/migrate-0.0.2.tgz","fileCount":6,"unpackedSize":7583,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHsSqhmF1I/tr70NSK8ZpGIP1itPRTijY9C/sEX1nhr2AiBskfJcCAyygzRRQPQlgTZ3HnFXEC8hSQQTlLqNU+pdTw=="}]},"_npmUser":{"name":"didierfranc","email":"mail@didierfranc.com"},"directories":{},"maintainers":[{"name":"didierfranc","email":"mail@didierfranc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/migrate_0.0.2_1736180027907_0.5714974218336644"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-06T16:02:49.765Z","modified":"2025-01-06T16:13:48.324Z","0.0.1":"2025-01-06T16:02:50.070Z","0.0.2":"2025-01-06T16:13:48.115Z"},"bugs":{"url":"https://github.com/agnosticeng/migrate/issues"},"homepage":"https://github.com/agnosticeng/migrate#readme","repository":{"type":"git","url":"git+https://github.com/agnosticeng/migrate.git"},"description":"A lightweight SQL migration manager for TypeScript/JavaScript applications.","maintainers":[{"name":"didierfranc","email":"mail@didierfranc.com"}],"readme":"# @agnosticeng/migrate\n\nA lightweight SQL migration manager for TypeScript/JavaScript applications.\n\n## Installation\n\n```bash\nnpm install @agnosticeng/migrate\n```\n\n## Usage\n\n```typescript\nimport { MigrationManager } from '@agnosticeng/migrate';\n\nconst database = {\n  // Your database implementation that satisfies IDatabase interface\n  exec: async (query: string, params?: any[]) => { /* ... */ }\n};\n\nconst migrations = [\n  {\n    name: '001-initial',\n    script: 'CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT);'\n  },\n  // ... more migrations\n];\n\nconst migrationManager = new MigrationManager(database);\nawait migrationManager.migrate(migrations);\n```\n\n## Features\n\n- Transaction-based migrations\n- Migration integrity verification using SHA-256 hashing\n- Prevents modified migrations from being re-run\n- TypeScript support\n- Browser compatible\n\n## API\n\n### `MigrationManager`\n\n```typescript\ninterface IDatabase {\n  exec: (query: string, params?: any[]) => Promise<any[]>;\n}\n\ninterface Migration {\n  name: string;\n  script: string;\n}\n\nclass MigrationManager {\n  constructor(database: IDatabase);\n  migrate(migrations: Migration[]): Promise<void>;\n}\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feat/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: Add some amazing feature'`)\n4. Push to the branch (`git push origin feat/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see below for details:\n\n```\nMIT License\n\nCopyright (c) 2024 Agnostic\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","readmeFilename":"README.md"}