{"_id":"@byndyusoft/nest-dynamic-module","_rev":"2-cb50c74eb3b2aea34bff0df9ec5824e7","name":"@byndyusoft/nest-dynamic-module","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@byndyusoft/nest-dynamic-module","version":"1.0.0","description":"DynamicModule helper for NestJS","homepage":"https://github.com/Byndyusoft/nest-dynamic-module#readme","bugs":{"url":"https://github.com/Byndyusoft/nest-dynamic-module/issues"},"repository":{"type":"git","url":"git+https://github.com/Byndyusoft/nest-dynamic-module.git"},"license":"Apache-2.0","author":{"name":"Byndyusoft"},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"prebuild":"shx rm -rf ./dist","build":"tsc --project ./tsconfig.build.json","lint":"yarn run lint:eslint && yarn run lint:markdown && yarn run lint:prettier","lint:fix":"yarn run lint:eslint:fix && yarn run lint:markdown:fix && yarn run lint:prettier:fix","lint:eslint":"eslint --ignore-path ./.gitignore --max-warnings 0 --ext .ts,.js .","lint:eslint:fix":"eslint --ignore-path ./.gitignore --fix --ext .ts,.js .","lint:markdown":"markdownlint --ignore-path ./.gitignore \"./**/*.md\"","lint:markdown:fix":"markdownlint --ignore-path ./.gitignore --fix \"./**/*.md\"","lint:prettier":"prettier --ignore-path ./.gitignore --check \"./**/*.{ts,js,json,yaml,yml,md}\"","lint:prettier:fix":"prettier --ignore-path ./.gitignore --write \"./**/*.{ts,js,json,yaml,yml,md}\"","_postinstall":"husky install && ts-patch install","postpublish":"pinst --enable","prepublishOnly":"pinst --disable","test":"jest","test:cov":"jest --coverage"},"jest":{"collectCoverageFrom":["./src/**/*.ts","!**/__tests__/**/*.ts","!**/index.ts"],"coverageDirectory":"<rootDir>/coverage","coverageThreshold":{"global":{"branches":100,"functions":100,"lines":100,"statements":100}},"moduleFileExtensions":["ts","js"],"resetMocks":true,"rootDir":"./","roots":["<rootDir>/src","<rootDir>/test"],"setupFiles":["reflect-metadata"],"setupFilesAfterEnv":["jest-extended"],"testEnvironment":"node","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.ts$":"ts-jest"}},"dependencies":{"tslib":"^2.3.1"},"devDependencies":{"@byndyusoft/eslint-config":"^1.1.0","@byndyusoft/tsconfig":"^1.1.0","@commitlint/cli":"^13.1.0","@commitlint/config-conventional":"^13.1.0","@nestjs/common":"^8.0.6","@types/jest":"^27.0.2","@types/node":"^16.9.6","eslint":"^7.32.0","husky":"^7.0.2","jest":"^27.2.1","jest-extended":"^0.11.5","lint-staged":"^11.1.2","markdownlint-cli":"^0.28.1","pinst":"^2.1.6","prettier":"^2.4.1","prettier-plugin-packagejson":"^2.2.12","reflect-metadata":"^0.1.13","semantic-release":"^18.0.0","shx":"^0.3.3","ts-jest":"^27.0.5","ts-patch":"^1.4.4","typescript":"^4.4.3","typescript-transform-paths":"^3.3.1"},"engines":{"node":">=12"},"publishConfig":{"access":"public"},"gitHead":"16363fc73add686b2f1702936feef173fda3d617","_id":"@byndyusoft/nest-dynamic-module@1.0.0","_nodeVersion":"14.17.6","_npmVersion":"7.24.0","dist":{"integrity":"sha512-hz120JkBVQb0kx58B/rH33RPj7lYre9zSoJDqGO1wdBNMGacgT/wCqAWzpr/rNbkpaZvgqktusEo4O0A8W/4wg==","shasum":"e72663cd3bc9f5bb88261a0b674ce239f7affcbd","tarball":"https://registry.npmjs.org/@byndyusoft/nest-dynamic-module/-/nest-dynamic-module-1.0.0.tgz","fileCount":24,"unpackedSize":29533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzanOCRA9TVsSAnZWagAA7usP/3dVx6HO0TIzwAKJttrU\nUnhxVJ9RxnJSXENho3wH/eXK+TYD7k78V2zcTGqnhuAuJcSGJjzB9fNMI/eG\nlewus6fFjYEHVIdrsgIqSyq1LxhQVAl3Y1BWW5I41DwF2epYIZ3MoBM3tSu7\n+GpDSoUsCaB2EfiFjVrwinX9ghN8u0Vgq3+TS7Fk2F3BuPDUkQAylO1KJpjR\nFwjJI4dqxuVHXdGNkSI78EMD81cJXJY4MSBkRayP38gswlz5Hi0TIvcAvqW6\nTQJxCYZ4GL6tgeUpsDXz31SxeIdp09aYGI1f6rfGi0KWxh8NgHxY5engnuvV\nUYcEJ1VwYO6Y0z60Lqs0atsc+KEiK3BL3DaJtgRGDoEIP3KFwe+NsQjfSiUV\nhQDLQigtL7BVsIp165c3fnzArIVOrOkNm+ZTOHmhPGxL1EfEfjmU2vndCG8J\n34V7eBr+ZwP+akysiZ48FbkmR1+8wf95+9cauf8x9AOpqzN/nfnogxmeU6+X\n/T1wuxsZDqDbnd8PUYSCnUB+/+rWG0K4JtDtjSqg1YoIlUC9/fNSoJSvktDH\nvx/s27MrQNtHwd2htZVev0PNvqclPEP3GRv04i3VDIaQJXF3E8+zO2C+WHai\nEZ3CrG2RV+mYRl7gQmBIOUV8qMiKf4z/cAb8zik4LEVNUEsLvHn4g0AcHAmr\ngZ5z\r\n=ifpQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGr+XeVG/CiP6MI0yCwutS7cUHpb2Uty4TUhBM+S4BbBAiEAnheTd+grtmuvUC8guC7ODwvz08+iEG+295yGFnZD22s="}]},"_npmUser":{"name":"alexanderbyndyu","email":"alexander.byndyu@gmail.com"},"directories":{},"maintainers":[{"name":"alexanderbyndyu","email":"alexander.byndyu@gmail.com"},{"name":"sadcitizen","email":"sadcitizen@yandex.ru"},{"name":"dmitriy.litichevskiy","email":"litichevskiydv@gmail.com"},{"name":"razonrus","email":"iruslansafin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nest-dynamic-module_1.0.0_1632996456628_0.9732041064270864"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-30T10:07:36.589Z","1.0.0":"2021-09-30T10:07:36.774Z","modified":"2022-04-04T21:19:49.713Z"},"maintainers":[{"name":"alexanderbyndyu","email":"alexander.byndyu@gmail.com"},{"name":"sadcitizen","email":"sadcitizen@yandex.ru"},{"name":"dmitriy.litichevskiy","email":"litichevskiydv@gmail.com"},{"name":"razonrus","email":"iruslansafin@gmail.com"}],"description":"DynamicModule helper for NestJS","homepage":"https://github.com/Byndyusoft/nest-dynamic-module#readme","repository":{"type":"git","url":"git+https://github.com/Byndyusoft/nest-dynamic-module.git"},"author":{"name":"Byndyusoft"},"bugs":{"url":"https://github.com/Byndyusoft/nest-dynamic-module/issues"},"license":"Apache-2.0","readme":"# nest-dynamic-module\n\n[![npm@latest](https://img.shields.io/npm/v/@byndyusoft/nest-dynamic-module/latest.svg)](https://www.npmjs.com/package/@byndyusoft/nest-dynamic-module)\n[![test workflow](https://github.com/Byndyusoft/nest-dynamic-module/actions/workflows/test.yaml/badge.svg?branch=master)](https://github.com/Byndyusoft/nest-dynamic-module/actions/workflows/test.yaml)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nDynamicModule helper for NestJS\n\n## Requirements\n\n- Node.js v12 LTS or later\n- npm or yarn\n\n## Install\n\n```bash\nnpm install @byndyusoft/nest-dynamic-module\n```\n\nor\n\n```bash\nyarn add @byndyusoft/nest-dynamic-module\n```\n\n## Usage\n\nExample usage:\n\n```typescript\nimport {\n  DynamicModuleHelper,\n  TRegisterAsyncOptions,\n} from \"@byndyusoft/nest-dynamic-module\";\nimport { DynamicModule, Inject, Injectable, Module } from \"@nestjs/common\";\n\nclass ExampleOptionsDto {\n  public readonly connectionString!: string;\n}\n\nconst EXAMPLE_OPTIONS_TOKEN = Symbol(\"EXAMPLE_OPTIONS_TOKEN\");\n\n@Injectable()\nclass ExampleProvider {\n  public constructor(\n    @Inject(EXAMPLE_OPTIONS_TOKEN)\n    options: ExampleOptionsDto,\n  ) {\n    console.log(options.connectionString);\n  }\n}\n\n@Module({})\nclass ExampleModule {\n  public static registerAsync(\n    options?: TRegisterAsyncOptions<ExampleOptionsDto>,\n  ): DynamicModule {\n    return DynamicModuleHelper.registerAsync(\n      {\n        module: ExampleModule,\n        global: true,\n        providers: [ExampleProvider],\n        exports: [ExampleProvider],\n      },\n      EXAMPLE_OPTIONS_TOKEN,\n      options,\n    );\n  }\n}\n\nclass ConfigDto {\n  public readonly exampleOptions!: ExampleOptionsDto;\n}\n\n@Module({\n  imports: [\n    ExampleModule.registerAsync({\n      inject: [ConfigDto],\n      useFactory: (config: ConfigDto) => config.exampleOptions,\n    }),\n  ],\n})\nclass AppModule {}\n```\n\n## Maintainers\n\n- [@Byndyusoft/owners](https://github.com/orgs/Byndyusoft/teams/owners) <<github.maintain@byndyusoft.com>>\n- [@Byndyusoft/team](https://github.com/orgs/Byndyusoft/teams/team)\n\n## License\n\nThis repository is released under version 2.0 of the\n[Apache License](https://www.apache.org/licenses/LICENSE-2.0).\n","readmeFilename":"README.md"}