{"_id":"@dmitriyzverev/locator","_rev":"1-964b76d63ae0f66548e26f333a2a0345","name":"@dmitriyzverev/locator","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0-dev.0":{"name":"@dmitriyzverev/locator","version":"1.0.0-dev.0","homepage":"https://gitlab.com/DmitriyZverev/locator","bugs":{"url":"https://gitlab.com/DmitriyZverev/locator/-/issues","email":"opensource@dmitriyzverev.ru"},"license":"MIT","author":{"name":"Dmitriy Zverev","email":"opensource@dmitriyzverev.ru"},"repository":{"type":"git","url":"git+https://gitlab.com/DmitriyZverev/locator.git"},"scripts":{"build":"rm -rf .package && npx tsc --outDir .package && cp package.json LICENSE README.md .package","eslint:fix":"npx eslint --no-error-on-unmatched-pattern --fix --ext .ts,.js .","eslint:check":"npx eslint --no-error-on-unmatched-pattern --ext .ts,.js .","prettier:fix":"npx prettier --write \"**/*.{ts,js,json,yml,md}\"","prettier:check":"npx prettier --check \"**/*.{ts,js,json,yml,md}\"","test":"npx jest -c .jestconfig.json"},"dependencies":{"tslib":"^2.0.0"},"devDependencies":{"@dmitriyzverev/eslint-config":"3.0.0","@dmitriyzverev/prettier-config":"1.0.1","@dmitriyzverev/typescript-config":"1.1.1","@types/jest":"29.5.0","@types/node":"16.18.23","eslint":"8.38.0","jest":"29.5.0","prettier":"2.8.7","ts-jest":"29.1.0","typescript":"5.0.4"},"types":"./index.d.ts","gitHead":"a9a36e688632f7244f183cafc4f479d452535077","description":"_Simple implementation of Service Locator pattern_","_id":"@dmitriyzverev/locator@1.0.0-dev.0","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-ZOAE6iQCXtxzwF8GzXOjzdtdKVcKDUeezXu1/JxeKoPAS+9qs/Q9++1jPSUoUGEhiLf3dq2DsA+ZizdFVMtdxQ==","shasum":"b656af7bbbf01df9dde5ff50de2434029386619d","tarball":"https://registry.npmjs.org/@dmitriyzverev/locator/-/locator-1.0.0-dev.0.tgz","fileCount":11,"unpackedSize":5237,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRwlG63uNK54b6b5AALrLMZzllQFMKBdttnPgRgBzi1QIhAKzCMBhlqVUBDo6cMHnZSGF58P0nI2TXhMrw8CXl4rrK"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN/txACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBPQ/+MJMR2bhjh3HotN1TuReLxY/LGIVhbFOjPhDs+fReOH9awRfY\r\ngiMo0pTerbyOrAWQuDRVPZMHTrvrdotSowU18BuZaewA6a9tMMqDLiQu0djK\r\nr0j22fT/LMci6BR3wUam2sYYzZPObwHnIO3Dh2kQX9p0HkLT//InA4qNoFWD\r\nqeWuuOP+1rif+bgCSIe0v22er6yp3mEjlIp6K//Qu0/npkzPyTQ7H/mDNfNz\r\nN6OLLeCG/ABwROru0uG3HsvAVc5qrDZ7Ji8re0p1GllNiksqkH30vA8XtxRg\r\nqwO98B/3PcK77FOb7I0B3ITZIHRL0gUi6fBIGbEJyE0L1ircydhdGRwddqbP\r\nwAyjqEY4B1CAe0O/54urLqsVoOkknvhH9W8ZacEbsYHXvwwD7S8RHUD457Av\r\nSyfNpU8vI5S26GOvJjn1GLpqFqmbFZ11C96/a3+Hj9AJieLI9RzyTg2A6oGy\r\nNX/WVgYRHcEOSajg8WLfUSKa6DSwBnB/nMN1/smg6DGHeT5iTlFKnqxrjf/l\r\nw9ifPK1p364SYaMngXgzdKsIucvM17+rCuYlC5i1iwGA7v7jQYlNek183To2\r\ntDu02CavDITYyJb4ksFXICLyPoZYA+VqbdUQFBurycufUp7AeZ0DguFEo3ox\r\nlD95CoL3HhNZoTG+fMqCrlEXzB4mbjTCKJk=\r\n=GXsS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dmitriyzverev","email":"zver.lockon@mail.ru"},"directories":{},"maintainers":[{"name":"dmitriyzverev","email":"zver.lockon@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/locator_1.0.0-dev.0_1681390449074_0.4252026802374764"},"_hasShrinkwrap":false},"1.0.0":{"name":"@dmitriyzverev/locator","version":"1.0.0","homepage":"https://gitlab.com/DmitriyZverev/locator","bugs":{"url":"https://gitlab.com/DmitriyZverev/locator/-/issues","email":"opensource@dmitriyzverev.ru"},"license":"MIT","author":{"name":"Dmitriy Zverev","email":"opensource@dmitriyzverev.ru"},"repository":{"type":"git","url":"git+https://gitlab.com/DmitriyZverev/locator.git"},"scripts":{"build":"rm -rf .package && npx tsc --outDir .package && cp package.json LICENSE README.md .package","eslint:fix":"npx eslint --no-error-on-unmatched-pattern --fix --ext .ts,.js .","eslint:check":"npx eslint --no-error-on-unmatched-pattern --ext .ts,.js .","prettier:fix":"npx prettier --write \"**/*.{ts,js,json,yml,md}\"","prettier:check":"npx prettier --check \"**/*.{ts,js,json,yml,md}\"","test":"npx jest -c .jestconfig.json"},"dependencies":{"tslib":"^2.0.0"},"devDependencies":{"@dmitriyzverev/eslint-config":"3.0.0","@dmitriyzverev/prettier-config":"1.0.1","@dmitriyzverev/typescript-config":"1.1.1","@types/jest":"29.5.0","@types/node":"16.18.23","eslint":"8.38.0","jest":"29.5.0","prettier":"2.8.7","ts-jest":"29.1.0","typescript":"5.0.4"},"types":"./index.d.ts","gitHead":"7fbd74913d51422dc648c85f67a8cb323d25c1eb","description":"_Simple implementation of Service Locator pattern with singletons and lazy loading_","_id":"@dmitriyzverev/locator@1.0.0","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-3KPLnU1N5Qv1WsWtUIs/zQuGeP7y6WNv74L2zoovnlgRY85ElnePc9+7SkCQ5vQKvpOKMj+gQgLQRmNotXfKUA==","shasum":"024f0d96a98465e73e8aa70e425e0915184585f4","tarball":"https://registry.npmjs.org/@dmitriyzverev/locator/-/locator-1.0.0.tgz","fileCount":11,"unpackedSize":5884,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNKh+HvOaHTJUKdftNGJITDnmDsC4RcbmS9V2eHn1N9QIhALY+v1icnt9JSAGl6WU18cfL9qxqYG21lzmTGLhgZLM3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQq+3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTMg//bK/cTBCHL/NKPJKfAz39GSTzsfGuFB4tPYdvlW7LNv1WGxxr\r\nnCmvTfexn+DKqfpOQIFobF/yQ51Jyom2dCg2mp58RlNZcCdAg8kLnzmpJiG3\r\n/KwQhRIqhXMOYf6HLpp4Z2rAAy5PzzvDR1BB6bWojR70A/KU1iGz/IhgNae7\r\nIimPMRAzcaNXzF/Fp+V0Io4fKgCVIxUl51naQeKN6r5lUbnwHbevm+xMSGLP\r\njhMc1kKKG01PuKMeQwXgA29A3X/1OsfPW2drpGsm9lkP1p1mtep2xnR3iQFp\r\nA5diIHpl58AFwCopSDgCHD0MJfOaCGOERCFy16cemk/U11Fbgj03X3dVk3ed\r\nDUDwJdCeqJbNn66ZInHoAnfpAspKcWvNx2b+LB/PbKDrzYtgef0DPIgOzffE\r\nRZJ8n7/gTc5mrmXbisgh2Z7K5p5dmCasTgHqRv9e5Q44UDIyF8xbXjFGDqTO\r\n9CLvsi0YgjDphG1OZfOXxrL6eYJTQghyNZ/xdOZ9vaGwu74TBLEVvrYLO3tf\r\nvBuTXJKdBD1ec4pUlqP45D7Iln0aSWlUKHA0tcjLLTkUoThVMu30AZQZNCxm\r\nQ3VW5aQplKT/CQssTsNE54R1Z6WfHr2/27SW+SGe0lEE1/3eV4Or9w9Udhc5\r\nusvU0Lk1X5dibIOZXpPcjE8AnWCpsV9QzHA=\r\n=o8YY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dmitriyzverev","email":"zver.lockon@mail.ru"},"directories":{},"maintainers":[{"name":"dmitriyzverev","email":"zver.lockon@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/locator_1.0.0_1682091959202_0.5389186074315029"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-13T12:54:09.015Z","1.0.0-dev.0":"2023-04-13T12:54:09.240Z","modified":"2023-04-21T15:45:59.531Z","1.0.0":"2023-04-21T15:45:59.422Z"},"maintainers":[{"name":"dmitriyzverev","email":"zver.lockon@mail.ru"}],"description":"_Simple implementation of Service Locator pattern with singletons and lazy loading_","homepage":"https://gitlab.com/DmitriyZverev/locator","repository":{"type":"git","url":"git+https://gitlab.com/DmitriyZverev/locator.git"},"author":{"name":"Dmitriy Zverev","email":"opensource@dmitriyzverev.ru"},"bugs":{"url":"https://gitlab.com/DmitriyZverev/locator/-/issues","email":"opensource@dmitriyzverev.ru"},"license":"MIT","readme":"# @dmitriyzverev/locator\n\n_Simple implementation of Service Locator pattern with singletons and lazy\nloading_\n\n---\n\n## Usage\n\n1. Install dependencies:\n\n    ```bash\n    npm i -SE @dmitriyzverev/locator\n    ```\n\n2. Create locator and define your services inside:\n    ```ts\n    import {createLocator} from '@dmitriyzverev/locator';\n    const locator = createLocator({\n        services: {\n            get user() {\n                return {\n                    name: 'Bob',\n                };\n            },\n            get helloMessage() {\n                return `Hello, ${locator.user.name}!`;\n            },\n        },\n    });\n    ```\n    Now you can use any service defined in locator:\n    ```ts\n    console.log(locator.helloMessage); // Hello, Bob!\n    ```\n    By default, each service is a singleton. It will be created only once, and\n    only if requested. If you need to create a new service instance for each\n    service request, disable the service singleton in the `singletons` property:\n    ```ts\n    import {createLocator} from '@dmitriyzverev/locator';\n    const locator = createLocator({\n        services: {\n            get user() {\n                return {\n                    name: 'Bob',\n                };\n            },\n        },\n        singletons: {\n            user: false,\n        },\n    });\n    console.log(locator.user === locator.user); // false\n    ```\n","readmeFilename":"README.md"}