{"id":20129376,"url":"https://github.com/ryanmorr/amble","last_synced_at":"2025-07-28T15:11:16.890Z","repository":{"id":96189676,"uuid":"607845922","full_name":"ryanmorr/amble","owner":"ryanmorr","description":"A stupid simple CSS lexer and walker","archived":false,"fork":false,"pushed_at":"2024-10-22T16:16:08.000Z","size":160,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T07:59:12.159Z","etag":null,"topics":["css","css-parser","javascript","lexer","walker"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanmorr.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":"2023-02-28T19:47:36.000Z","updated_at":"2024-10-22T16:16:12.000Z","dependencies_parsed_at":"2025-04-09T16:09:55.442Z","dependency_job_id":"082fc96c-2e80-4f37-b731-0324be588bf7","html_url":"https://github.com/ryanmorr/amble","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"c3532862a08f57e63f82d987506602b1298a1123"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ryanmorr/amble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Famble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Famble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Famble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Famble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanmorr","download_url":"https://codeload.github.com/ryanmorr/amble/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Famble/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264866036,"owners_count":23675673,"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","css-parser","javascript","lexer","walker"],"created_at":"2024-11-13T20:33:58.372Z","updated_at":"2025-07-28T15:11:16.848Z","avatar_url":"https://github.com/ryanmorr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amble\n\n[![Version Badge][version-image]][project-url]\n[![License][license-image]][license-url]\n[![Build Status][build-image]][build-url]\n\n\u003e A stupid simple CSS lexer and walker\n\n## Install\n\nDownload the [CJS](https://github.com/ryanmorr/amble/raw/master/dist/cjs/amble.js), [ESM](https://github.com/ryanmorr/amble/raw/master/dist/esm/amble.js), [UMD](https://github.com/ryanmorr/amble/raw/master/dist/umd/amble.js) versions or install via NPM:\n\n```sh\nnpm install @ryanmorr/amble\n```\n\n## Usage\n\nGiven a string of CSS, amble will break it into logical segments such as a selector, an at-rule, or a declaration and sequentially walks them by calling a function. The function is provided the segment of CSS and the ending character used to indicate the type of segment as the only two parameters. The ending character is one of an opening brace (`{`) to indicate the start of a block, a semi-colon (`;`) to indicate a declaration, or a closing brace (`}`) to indicate the end of a block. For example:\n\n```javascript\nimport { walk } from '@ryanmorr/amble';\n\nconst css = `\n    .foo {\n        color: red;\n    }\n\n    @media screen and (max-width: 480px) {\n        .foo {\n            color: blue;\n        }\n    }\n`;\n\nwalk(css, (style, char) =\u003e {\n    console.log([style, char]);\n});\n```\n\nPrints the following to the console:\n\n```javascript\n[\".foo\", \"{\"]\n[\"color:red\", \";\"]\n[\"\", \"}\"]\n[\"@media screen and (max-width: 480px)\", \"{\"]\n[\".foo\", \"{\"]\n[\"color:blue\", \";\"]\n[\"\", \"}\"]\n[\"\", \"}\"]\n```\n\n## License\n\nThis project is dedicated to the public domain as described by the [Unlicense](http://unlicense.org/).\n\n[project-url]: https://github.com/ryanmorr/amble\n[version-image]: https://img.shields.io/github/package-json/v/ryanmorr/amble?color=blue\u0026style=flat-square\n[build-url]: https://github.com/ryanmorr/amble/actions\n[build-image]: https://img.shields.io/github/actions/workflow/status/ryanmorr/amble/node.js.yml?style=flat-square\n[license-image]: https://img.shields.io/github/license/ryanmorr/amble?color=blue\u0026style=flat-square\n[license-url]: UNLICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Famble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanmorr%2Famble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Famble/lists"}