{"id":18358798,"url":"https://github.com/uppercod/imported","last_synced_at":"2025-04-10T03:00:17.487Z","repository":{"id":113251125,"uuid":"288639000","full_name":"UpperCod/imported","owner":"UpperCod","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-08T19:13:52.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-16T12:04:05.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UpperCod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-19T05:10:15.000Z","updated_at":"2020-09-08T19:13:54.000Z","dependencies_parsed_at":"2023-07-21T21:31:20.423Z","dependency_job_id":null,"html_url":"https://github.com/UpperCod/imported","commit_stats":null,"previous_names":["uppercod/index-tree"],"tags_count":0,"template":false,"template_full_name":"UpperCod/pkg-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fimported","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fimported/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fimported/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fimported/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpperCod","download_url":"https://codeload.github.com/UpperCod/imported/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148217,"owners_count":21055547,"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":[],"created_at":"2024-11-05T22:19:26.735Z","updated_at":"2025-04-10T03:00:16.427Z","avatar_url":"https://github.com/UpperCod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imported\n\nThis script allows to create dependency relationships between indexes, this relationship can be referential to a shared dependency or deep nesting, it can be used to manage files.\n\n## install\n\n```\nnpm install @uppercod/imported\n```\n\n## example\n\nCheck test/index.test.js for the api implementation.\n\n```js\nimport createImported from \"@uppercod/imported\";\n\nconst tree = createImported();\n\ntree.add(\"a\");\n\ntree.addChild(\"a\", \"b\");\n\ntree.add(\"b\", \"c\");\n\ntree.getParents(\"c\"); // return a\n```\n\n## tree object\n\nThe tree object shows the import relationship between the nodes, the nodes are not required to have a direct relationship, but can be a reference to a deeper import.\n\n## tree functions\n\n### tree.add\n\nDeclare an index as root, a dependency as root can only be removed directly by tree.remove.\n\n### tree.addChild\n\nCreate a relationship between indices, this relationship allows to guarantee a joint elimination.\n\n### tree.get\n\nGets or creates a record index.\n\n### tree.has\n\nCheck if the index exists.\n\n### tree.getRoots\n\nGet the root indices of an index.\n\n### tree.remove\n\nDelete an index and all its relations except those declared as root.\n\n### tree.graph\n\nGets the indexes on a descending object related to the index.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Fimported","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuppercod%2Fimported","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Fimported/lists"}