{"id":15979348,"url":"https://github.com/perry-mitchell/css-selector-splitter","last_synced_at":"2025-05-07T06:43:51.081Z","repository":{"id":57210933,"uuid":"66251674","full_name":"perry-mitchell/css-selector-splitter","owner":"perry-mitchell","description":"Split CSS selectors by commas or blocks","archived":false,"fork":false,"pushed_at":"2016-08-24T06:29:28.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T07:22:34.390Z","etag":null,"topics":["css-selector","css-selector-parser","css-selectors","query","splitting"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/perry-mitchell.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":"2016-08-22T07:59:21.000Z","updated_at":"2023-06-15T09:55:21.000Z","dependencies_parsed_at":"2022-09-01T08:21:40.502Z","dependency_job_id":null,"html_url":"https://github.com/perry-mitchell/css-selector-splitter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcss-selector-splitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcss-selector-splitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcss-selector-splitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcss-selector-splitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perry-mitchell","download_url":"https://codeload.github.com/perry-mitchell/css-selector-splitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831176,"owners_count":21810779,"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":["css-selector","css-selector-parser","css-selectors","query","splitting"],"created_at":"2024-10-07T23:42:27.080Z","updated_at":"2025-05-07T06:43:51.063Z","avatar_url":"https://github.com/perry-mitchell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css-selector-splitter\nSplit CSS selectors by commas or blocks\n\n[![Build Status](https://travis-ci.org/perry-mitchell/css-selector-splitter.svg?branch=master)](https://travis-ci.org/perry-mitchell/css-selector-splitter)\n\n## Compatibility\nNode v6 is supported (full ES6).\n\n## Why make this?\n_Are their other splitting libraries? Do they do the same thing as yours?_\nYes and somewhat. This library allows for splitting of relationship blocks too: \"div \u003e a ~ p\". Other libraries that I've tested also don't cater for text within attribute values, so [splitting fails](https://github.com/joakimbeng/split-css-selector/issues/1) if certain characters are encountered within these fields.\n\n## Usage\nSimply require the main function:\n\n```\nconst splitSelector = require(\"css-selector-splitter\");\n\nlet selectors = splitSelector(\"div#gallery, div.slide\"); // [\"div#gallery\", \"div.slide\"]\n```\n\nThis library also supports the splitting of relationship blocks:\n\n```\nconst splitSelectorBlocks = require(\"css-selector-splitter\").splitSelectorBlocks;\n\nlet items = splitSelectorBlocks(\"div.level1 div#level2 \u003e span.level3 ~ p\");\n// returns:\n// {\n//   selectors: [\n//     \"div.level1\",\n//     \"div#level2\",\n//     \"span.level3\",\n//     \"p\"\n//   ],\n//   joiners: [\n//     \" \",\n//     \"\u003e\",\n//     \"~\"\n//   ]\n// }\n```\n\nYou can join selectors as well:\n\n```\nconst joinSelector = require(\"css-selector-splitter\").joinSelector;\n\nlet selector = joinSelector([\"div.a\", \"div.b\"], [\"\u003e\"]); // this can also be output from 'splitSelectorBlocks'\n// returns: \"div.a \u003e div.b\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fcss-selector-splitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperry-mitchell%2Fcss-selector-splitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fcss-selector-splitter/lists"}