{"id":19858157,"url":"https://github.com/brianneisler/firetree","last_synced_at":"2025-06-13T14:11:10.419Z","repository":{"id":38426084,"uuid":"309219699","full_name":"brianneisler/firetree","owner":"brianneisler","description":"AST parser and generator for Firebase Firestore and Storage security rules ","archived":false,"fork":false,"pushed_at":"2023-01-07T05:03:52.000Z","size":1139,"stargazers_count":8,"open_issues_count":9,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-24T03:42:45.681Z","etag":null,"topics":["ast-parser","firebase","firebase-storage","firestore","security-rules"],"latest_commit_sha":null,"homepage":"https://firetree.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianneisler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-02T00:41:31.000Z","updated_at":"2024-10-03T11:07:42.000Z","dependencies_parsed_at":"2023-02-06T12:31:07.909Z","dependency_job_id":null,"html_url":"https://github.com/brianneisler/firetree","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":"brianneisler/node-package-template","purl":"pkg:github/brianneisler/firetree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianneisler%2Ffiretree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianneisler%2Ffiretree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianneisler%2Ffiretree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianneisler%2Ffiretree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianneisler","download_url":"https://codeload.github.com/brianneisler/firetree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianneisler%2Ffiretree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259659667,"owners_count":22891672,"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":["ast-parser","firebase","firebase-storage","firestore","security-rules"],"created_at":"2024-11-12T14:21:45.626Z","updated_at":"2025-06-13T14:11:10.383Z","avatar_url":"https://github.com/brianneisler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firetree 🔥🌲\n\nAST parser and generator for Firebase Firestore and Storage security rules\n\n## Project Status\n\n[![license](https://img.shields.io/npm/l/moltres.svg)](https://github.com/brianneisler/moltres/blob/master/LICENSE)\n[![npm version](https://badge.fury.io/js/firetree.svg)](https://badge.fury.io/js/firetree)\u003cbr /\u003e\n[![Build Status](https://travis-ci.com/brianneisler/firetree.svg)](https://travis-ci.com/brianneisler/firetree)\u003cbr /\u003e\n[![Code coverage](https://codecov.io/gh/brianneisler/firetree/branch/main/graph/badge.svg)](https://codecov.io/gh/brianneisler/firetree/branch/main/)\u003cbr /\u003e\n[![NPM](https://nodei.co/npm/firetree.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/firetree/)\n\n## Documentation\n\n[Full API documentation](docs/API.md) - Learn about each method\n\n## Why?\n\nFirestore security rules lacks an available AST parser.... so I made one.\n\nThis can come in handy for making additional tools, like IDE plugins, security\nrules analyzers or even a [minifier](https://github.com/brianneisler/firemin)\n\n## Features\n\n- [x] Parses firestore rules into an AST\n- [x] Generates rules from an AST\n\n## TODO\n\n- [ ] Support stdin and stdout for the binary commands\n\n## Install\n\n```sh\nnpm install --save-dev firetree\n```\n\n## Usage\n\nThe firetree parser can be used as an imported library or as a binary.\n\n## Using Programmatically\n\nTo do so, simply\ninstall `firetree` as a project dependency and then\nimport the necessary methods from the `firetree` package\n\n```sh\nnpm install --save firetree\n```\n\n```js\nimport { generate, parse, setupContext } from 'firetree'\n\nconst context = setupContext()\n\nconst ast = await parse(context, {\n  filePath: './path/to/firestore.rules')\n})\nconst rulesString = await generate(context, { ast })\n```\n\n## Using the Binary\n\nYou can using the binary directly by installing globally\n\n```sh\nnpm install -g firemin\n```\n\nTo parse a rules file, use the `parse` command\n\n```sh\nfiretree parse -f ./path/to/my-firestore.rules\n```\n\nBy default the output file is `./firestore.ast.rules.json`. To specify a different\npath you can use the `-o` option.\n\n```sh\nfiretree parse -f ./path/to/my-firestore.rules -o ./output/file/my-firestore.ast.rules.json\n```\n\nTo generate a rules file from an AST, use the `generate` command\n\n```sh\nfiretree generate -f ./path/to/my-firestore.ast.rules.json\n```\n\nBy default the output file is `./firestore.rules`. To specify a different\npath you can use the `-o` option.\n\n```sh\nfiretree generate -f ./path/to/my-firestore.ast.rules.json -o ./output/file/my-firestore.rules\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianneisler%2Ffiretree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianneisler%2Ffiretree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianneisler%2Ffiretree/lists"}