{"_id":"@debiprasadmishra50/swagger-dark-mode","_rev":"2-5e956ce2155c7c41e5007ae34c57e98b","name":"@debiprasadmishra50/swagger-dark-mode","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@debiprasadmishra50/swagger-dark-mode","version":"1.0.0","keywords":["swagger","swagger-ui","dark-mode","express","middleware","api-documentation","theme","typescript"],"author":{"name":"Debi Prasad Mishra","email":"debiprasadmishra50@gmail.com"},"license":"MIT","_id":"@debiprasadmishra50/swagger-dark-mode@1.0.0","maintainers":[{"name":"debiprasadmishra50","email":"debiprasadmishra50@gmail.com"}],"homepage":"https://github.com/debiprasadmishra50/swagger-dark-mode#readme","bugs":{"url":"https://github.com/debiprasadmishra50/swagger-dark-mode/issues"},"dist":{"shasum":"8247107c03e7dc2ba52602395dbc316a81b3c5d8","tarball":"https://registry.npmjs.org/@debiprasadmishra50/swagger-dark-mode/-/swagger-dark-mode-1.0.0.tgz","fileCount":15,"integrity":"sha512-eA+BOdU6HGjJq16SnWF+oTbX8cWGRUhP6KgoIliwbwxIv0Yae30RbuuqM6wRG4If6t/zQuggb9KszCkM82nllA==","signatures":[{"sig":"MEUCIQDvT31VUSMB5n5NT/4AhDfUrx5awkQwO9f0Yair9uGEcAIgLwTouL8Fg199b2TKFzIBATBHVMSBIS6owctqNriYIGc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25265},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"scripts":{"build":"tsc","clean":"rm -rf dist","prepublishOnly":"npm run build"},"_npmUser":{"name":"debiprasadmishra50","email":"debiprasadmishra50@gmail.com"},"repository":{"url":"git+https://github.com/debiprasadmishra50/swagger-dark-mode.git","type":"git"},"_npmVersion":"10.8.1","description":"A simple middleware to add dark mode functionality to Swagger UI","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@types/express":"^4.17.21"},"peerDependencies":{"express":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swagger-dark-mode_1.0.0_1753979195867_0.5642246147411791","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@debiprasadmishra50/swagger-dark-mode","version":"1.0.1","description":"A simple middleware to add dark mode functionality to Swagger UI","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build","clean":"rm -rf dist"},"keywords":["swagger","swagger-ui","dark-mode","express","middleware","api-documentation","theme","typescript"],"author":{"name":"Debi Prasad Mishra","email":"debiprasadmishra50@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/debiprasadmishra50/swagger-dark-mode.git"},"bugs":{"url":"https://github.com/debiprasadmishra50/swagger-dark-mode/issues"},"homepage":"https://github.com/debiprasadmishra50/swagger-dark-mode#readme","devDependencies":{"@types/express":"^4.17.21","@types/node":"^20.0.0","typescript":"^5.0.0"},"peerDependencies":{"express":"^4.0.0"},"engines":{"node":">=14.0.0"},"_id":"@debiprasadmishra50/swagger-dark-mode@1.0.1","gitHead":"e0c8f9b5f7d322b4f2d06b4d90f2a587794c5b46","_nodeVersion":"20.10.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-4f+ddptBSoX3vzN/eSJNw6FpHL1NFy/pPKTYW8AiVZeAg/Bj76o1HXJMrFv5Fbfp5Pt6Bi0UOdjyiFs2jDPlPg==","shasum":"17d70c70e0703ab2762b4e758bf976ce9d4e5d40","tarball":"https://registry.npmjs.org/@debiprasadmishra50/swagger-dark-mode/-/swagger-dark-mode-1.0.1.tgz","fileCount":15,"unpackedSize":25524,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCntE/8GFAGmBsn+kGIGbgAFvcNMu6a5Ltk+G1YuKV0XgIgAcJQc6OV6TFyShZghqIlv4WplIxboxBW2r8K9QB9paE="}]},"_npmUser":{"name":"debiprasadmishra50","email":"debiprasadmishra50@gmail.com"},"directories":{},"maintainers":[{"name":"debiprasadmishra50","email":"debiprasadmishra50@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/swagger-dark-mode_1.0.1_1753980853506_0.2381067927053402"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-31T16:26:35.726Z","modified":"2025-07-31T16:54:13.896Z","1.0.0":"2025-07-31T16:26:36.054Z","1.0.1":"2025-07-31T16:54:13.700Z"},"bugs":{"url":"https://github.com/debiprasadmishra50/swagger-dark-mode/issues"},"author":{"name":"Debi Prasad Mishra","email":"debiprasadmishra50@gmail.com"},"license":"MIT","homepage":"https://github.com/debiprasadmishra50/swagger-dark-mode#readme","keywords":["swagger","swagger-ui","dark-mode","express","middleware","api-documentation","theme","typescript"],"repository":{"type":"git","url":"git+https://github.com/debiprasadmishra50/swagger-dark-mode.git"},"description":"A simple middleware to add dark mode functionality to Swagger UI","maintainers":[{"name":"debiprasadmishra50","email":"debiprasadmishra50@gmail.com"}],"readme":"# Swagger Dark Mode\n\nA simple middleware that adds dark mode functionality to Swagger UI with a toggle switch.\n\n## Installation\n\n```bash\nnpm install @debiprasadmishra50/swagger-dark-mode\n```\n\n## Usage\n\n### Express.js\n\n```typescript\nimport express from \"express\";\nimport swaggerUi from \"swagger-ui-express\";\nimport { swaggerDarkModeMiddleware, SWAGGER_CUSTOM_CSS } from \"@debiprasadmishra50/swagger-dark-mode\";\n\nconst app = express();\n\n// Apply the dark mode middleware\napp.use(\"/api\", swaggerDarkModeMiddleware);\n\n// Setup Swagger UI with custom CSS\napp.use(\n  \"/api\",\n  swaggerUi.serve,\n  swaggerUi.setup(swaggerDocument, {\n    customCss: SWAGGER_CUSTOM_CSS,\n  })\n);\n```\n\n### JavaScript (CommonJS)\n\n```javascript\nconst express = require(\"express\");\nconst swaggerUi = require(\"swagger-ui-express\");\nconst { swaggerDarkModeMiddleware, SWAGGER_CUSTOM_CSS } = require(\"@debiprasadmishra50/swagger-dark-mode\");\n\nconst app = express();\n\napp.use(\"/api\", swaggerDarkModeMiddleware);\napp.use(\n  \"/api\",\n  swaggerUi.serve,\n  swaggerUi.setup(swaggerDocument, {\n    customCss: SWAGGER_CUSTOM_CSS,\n  })\n);\n```\n\n### NestJS\n\n```typescript\nimport { NestFactory } from \"@nestjs/core\";\nimport { SwaggerModule, DocumentBuilder } from \"@nestjs/swagger\";\n// import the middlewares\nimport { swaggerDarkModeMiddleware, SWAGGER_CUSTOM_CSS } from \"@debiprasadmishra50/swagger-dark-mode\";\n\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule);\n\n  // Apply dark mode middleware\n  app.use(\"/api\", swaggerDarkModeMiddleware);\n\n  const config = new DocumentBuilder()\n    .setTitle(\"Your API\")\n    .setDescription(\"API description\")\n    .setVersion(\"1.0\")\n    .build();\n\n  const document = SwaggerModule.createDocument(app, config, { ignoreGlobalPrefix: false });\n  SwaggerModule.setup(\"api\", app, document, {\n    swaggerOptions: {\n      tagsSorter: \"alpha\",\n      docExpansion: \"none\",\n    },\n    // Apply the custom CSS\n    customCss: SWAGGER_CUSTOM_CSS,\n  });\n\n  await app.listen(3000);\n}\n```\n\n## Features\n\n- 🌙 **Dark Mode Toggle**: Adds a toggle switch to Swagger UI\n- 💾 **Persistent Settings**: Remembers user preference in localStorage\n- 🎨 **Complete Styling**: Dark theme for all Swagger UI components\n- ⚡ **Easy Integration**: Simple middleware for any Express-based app\n- 🔧 **TypeScript Support**: Full TypeScript definitions included\n\n## API\n\n### `swaggerDarkModeMiddleware`\n\nExpress middleware that injects dark mode toggle into Swagger UI pages.\n\n### `SWAGGER_CUSTOM_CSS`\n\nCSS string containing dark mode styles for Swagger UI.\n\n## Examples\n\n### Nest JS Example\n\n![nestjs-example](./resources/images/nest-js-example.png)\n\n### Nest JS Request Example\n\n![nestjs-request-example](./resources/images/request-example.png)\n\n### Express JS Example\n\n![express-js-example](./resources/images/express-js-example.png)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}