{"id":16542447,"url":"https://github.com/tada5hi/singa","last_synced_at":"2026-02-11T04:01:48.550Z","repository":{"id":220787765,"uuid":"752206481","full_name":"tada5hi/singa","owner":"tada5hi","description":"A tiny library to create and manage singleton instances.","archived":false,"fork":false,"pushed_at":"2025-10-13T19:30:54.000Z","size":456,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-15T04:48:30.039Z","etag":null,"topics":["instance","singleton","singleton-design-pattern"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tada5hi.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["tada5hi"]}},"created_at":"2024-02-03T10:52:16.000Z","updated_at":"2025-07-28T13:21:47.000Z","dependencies_parsed_at":"2024-02-04T11:08:27.203Z","dependency_job_id":"28c0343c-e7bf-47ee-b012-0d5947271fde","html_url":"https://github.com/tada5hi/singa","commit_stats":null,"previous_names":["tada5hi/singa"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tada5hi/singa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fsinga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fsinga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fsinga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fsinga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tada5hi","download_url":"https://codeload.github.com/tada5hi/singa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fsinga/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29326815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["instance","singleton","singleton-design-pattern"],"created_at":"2024-10-11T18:57:33.391Z","updated_at":"2026-02-11T04:01:48.545Z","avatar_url":"https://github.com/tada5hi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/tada5hi"],"categories":[],"sub_categories":[],"readme":"# singa 🏛️\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm version][codecov-src]][codecov-href]\n[![Master Workflow][workflow-src]][workflow-href]\n[![Known Vulnerabilities][snyk-src]][snyk-href]\n[![Conventional Commits][conventional-src]][conventional-href]\n\nThis is a tiny library to create and manage singleton instances.\n\n**Table of Contents**\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\n```bash\nnpm install singa --save\n```\n\n## Usage\n\nThe **singa** function returns an object of type [Singa](#singa),\nwith all input parameters, including name and factory, being entirely optional.\n\n**Sync**\n```typescript\nimport { singa } from 'singa';\n\nclass Foo {\n\n}\n\nconst singleton = singa({\n    name: 'singleton',\n    factory() {\n        return new Foo();\n    },\n});\n\nconst instance = singleton.use();\n```\n\n**Async**\n```typescript\nimport { singaAsync } from 'singa';\n\nclass Foo {\n\n}\n\nconst singleton = singaAsync({\n    name: 'singleton',\n    async factory() {\n        await Promise.resolve();\n        return new Foo();\n    },\n});\n\nconst instance = await singleton.use();\n```\n\n## Contributing\n\nBefore starting to work on a pull request, it is important to review the guidelines for\n[contributing](./CONTRIBUTING.md) and the [code of conduct](./CODE_OF_CONDUCT.md).\nThese guidelines will help to ensure that contributions are made effectively and are accepted.\n\n## License\n\nMade with 💚\n\nPublished under [MIT License](./LICENSE).\n\n[npm-version-src]: https://badge.fury.io/js/singa.svg\n[npm-version-href]: https://npmjs.com/package/singa\n[codecov-src]: https://codecov.io/gh/Tada5hi/singa/branch/master/graph/badge.svg?token=4KNSG8L13V\n[codecov-href]: https://codecov.io/gh/Tada5hi/singa\n[workflow-src]: https://github.com/Tada5hi/singa/workflows/CI/badge.svg\n[workflow-href]: https://github.com/Tada5hi/singa\n[snyk-src]: https://snyk.io/test/github/Tada5hi/singa/badge.svg?targetFile=package.json\n[snyk-href]: https://snyk.io/test/github/Tada5hi/singa?targetFile=package.json\n[conventional-src]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits\u0026logoColor=white\n[conventional-href]: https://conventionalcommits.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada5hi%2Fsinga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftada5hi%2Fsinga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada5hi%2Fsinga/lists"}