{"id":17256156,"url":"https://github.com/jalal246/corename","last_synced_at":"2025-03-26T08:18:35.835Z","repository":{"id":37007741,"uuid":"242189299","full_name":"jalal246/corename","owner":"jalal246","description":"Automatically extracts packages root name for monorepos ","archived":false,"fork":false,"pushed_at":"2022-08-28T14:28:41.000Z","size":114,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T17:18:43.306Z","etag":null,"topics":["corename","extract-data","extract-information","extract-text","extracts","get-info","monorepo","package-development","package-json","package-management","production","read-json","utility"],"latest_commit_sha":null,"homepage":"https://jalal246.github.io/corename/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jalal246.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-21T17:01:10.000Z","updated_at":"2023-03-15T17:13:56.000Z","dependencies_parsed_at":"2022-08-18T00:20:20.188Z","dependency_job_id":null,"html_url":"https://github.com/jalal246/corename","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Fcorename","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Fcorename/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Fcorename/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Fcorename/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jalal246","download_url":"https://codeload.github.com/jalal246/corename/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245615025,"owners_count":20644378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["corename","extract-data","extract-information","extract-text","extracts","get-info","monorepo","package-development","package-json","package-management","production","read-json","utility"],"created_at":"2024-10-15T07:13:45.063Z","updated_at":"2025-03-26T08:18:35.804Z","avatar_url":"https://github.com/jalal246.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# corename\n\n\u003e Extracts the name of monorepo project\n\n```bash\nnpm install corename\n```\n\n## API\n\n### getCoreName\n\n```ts\ngetCoreName(pkgJson: Array\u003cpkgJsonObj\u003e|Object)\n```\n\n### Usage\n\n```js\nimport getCoreName from \"corename\";\n\nconst pkg0 = {\n  name: \"pkg-first\",\n  dependencies: {},\n};\n\nconst pkg1 = {\n  name: \"@pkg-second\",\n  dependencies: {\n    \"@pkg/first\": \"^0.1.5\",\n  },\n};\n\nconst pkg2 = {\n  name: \"@pkg/third\",\n  dependencies: {},\n};\n\nconst name = getCoreName([pkg0, pkg1, pkg2]);\n\n// name = \"@pkg\";\n```\n\nOr just pass a single package\n\n```js\nconst name = getCoreName(pkg2);\n\n// name = \"@pkg\";\n```\n\nIn case there's no matching pattern, it returns null:\n\n```js\nconst name = getCoreName(pkg1);\n\n// name = null;\n```\n\nOr tell it to return the exact name found in package.json\n\n```js\nconst returnNameIfMonoNotFound = true;\n\nconst name = getCoreName(pkg1, returnNameIfMonoNotFound);\n\n// name = \"@pkg-second\";\n```\n\n### Tests\n\n```sh\nnpm test\n```\n\n### License\n\nThis project is licensed under the [GPL-3.0 License](https://github.com/jalal246/corename/blob/master/LICENSE)\n\n### Related projects\n\n- [builderz](https://github.com/jalal246/builderz) - JavaScript Bundler with zero configuration.\n\n- [packageSorter](https://github.com/jalal246/packageSorter) - Sorting packages\n  for monorepos production.\n\n- [get-info](https://github.com/jalal246/get-info) - Utility functions for projects production\n\n- [move-position](https://github.com/jalal246/move-position) - Moves element\n  index in an array.\n\n- [textics](https://github.com/jalal246/textics) \u0026 [textics-stream](https://github.com/jalal246/textics-stream) - Counts lines, words, chars and spaces for a given string.\n\n- [folo](https://github.com/jalal246/folo) - Form \u0026 Layout Components Built with\n  React.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalal246%2Fcorename","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjalal246%2Fcorename","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalal246%2Fcorename/lists"}