{"id":15999751,"url":"https://github.com/danburzo/yamatter","last_synced_at":"2025-03-17T14:31:49.854Z","repository":{"id":65840635,"uuid":"601139123","full_name":"danburzo/yamatter","owner":"danburzo","description":"Inspect and transform YAML frontmatter data from the command line.","archived":false,"fork":false,"pushed_at":"2024-08-15T13:38:44.000Z","size":169,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T00:37:58.935Z","etag":null,"topics":["cli","yaml"],"latest_commit_sha":null,"homepage":"https://danburzo.ro/projects/yamatter/","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/danburzo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-13T13:00:55.000Z","updated_at":"2024-08-15T13:38:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"46877a82-a9e4-4ac6-a8c8-cd3a8f8e64a6","html_url":"https://github.com/danburzo/yamatter","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"862e073fa0f3e63b0cd7592e78fe181c08f0849c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danburzo%2Fyamatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danburzo%2Fyamatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danburzo%2Fyamatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danburzo%2Fyamatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danburzo","download_url":"https://codeload.github.com/danburzo/yamatter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243864820,"owners_count":20360360,"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":["cli","yaml"],"created_at":"2024-10-08T09:01:01.111Z","updated_at":"2025-03-17T14:31:49.543Z","avatar_url":"https://github.com/danburzo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yamatter is a command-line tool to inspect and transform YAML front-matter data  using [`js-yaml`](https://github.com/nodeca/js-yaml).\n\n## Installation\n\nInstall `yamatter` globally with `npm`:\n\n```bash\nnpm install -g yamatter\n```\n\nRun `yamatter` without installing it with `npx`:\n\n```bash\nnpx yamatter\n```\n\n## Usage\n\n```bash\nyamatter [OPTIONS] [PATTERN ...]\n```\n\n### Operands\n\nThe `yamatter` command accepts one or more glob patterns to match the files from which to read front-matter data. \n\nThe patterns are expanded by [`fast-glob`](https://github.com/mrmlnc/fast-glob). In order for the glob patterns to be expanded with `fast-glob` and not the shell that runs the command (e.g. `sh`, `bash`, `zsh`), make sure pass them enclosed in quotes:\n\n```bash\nyamatter 'content/**/*.md' 'notes/*.md'\n```\n\n`yamatter` looks for lines beginning with three or more hyphens (`---`) as the delimiter for front-matter data. Any matching files without front-matter data delimiters are ignored. \n\nBy default, `yamatter` ignores files matched by patterns inside `.gitignore`, if it finds one in the current working directory. It does not look for other `.gitignore` files neither up, nor down, the file system hierarchy. You can disable the ignore behavior with the `--no-ignore` flag.\n\nSymbolic links (symlinks) are not followed. This helps avoid accidentally processing files outside the current working directory.\n\n### Options\n\n#### `--no-ignore`\n\nDon’t ignore files based on patterns found in `.gitignore`.\n\n#### `--silent`\n\nDon’t output to the standard output. \n\n#### `--no-filename`\n\nDon’t output filenames to the standard output.\n\n#### `--json`\n\nWhen outputting to the standard output, serialize the data as JSON instead of YAML.\n\n#### `-t \u003cfile\u003e, --transform=\u003cfile\u003e`\n\nPoint to a JavaScript module, relative to the current working directory, that performs a transformation on the front-matter data. \n\nThe module must export a function that receives these arguments:\n\n* `data`: a JSON object corresponding to the original front-matter data\n* `filepath`: the source file path, relative to the current working directory\n\nYou can alter `data` directly, or return a new object in its place.\n\n```bash\nyamatter '*.md' -t to-uppercase.js\n```\n\n__to-uppercase.js__:\n\n```js\nmodule.exports = function(data, filepath) {\n\tdata.title = data.title.toUpperCase();\n};\n```\n\n#### `-w, --write`\n\nWrite the result of the transformation back to the file.\n\n__Pro tip:__ Since this has the potential to be destructive, it is recommended that you run any `yamatter --write` commands in a folder that’s managed by a source control system such as Git, with any pending changes committed. This makes it easy to revert the files back to their original content.\n\n#### `--glob.\u003coption\u003e=\u003cvalue\u003e`\n\nPass options to [`fast-glob`](https://github.com/mrmlnc/fast-glob) directly. These options are passed by default:\n\n```json\n{\n\t\"followSymbolicLinks\": false\n}\n```\n\nBoolean and numeric values are cast to their respective data types. Other values are passed as strings, which limits the amount of `fast-glob` customization available.\n\n#### `--yaml.\u003coption\u003e=\u003cvalue\u003e`\n\nPass serialization options to [`js-yaml`](https://github.com/nodeca/js-yaml)’s `dump()` method. These options are passed by default:\n\n```json\n{\n\t\"lineWidth\": -1\n}\n```\n\nBoolean and numeric values are cast to their respective data types. Other values are passed as strings, which limits the amount of `js-yaml` customization available.\n\n## See also\n\n* [mikefarah/yq](https://github.com/mikefarah/yq)\n* [dbohdan/structured-text-tools](https://github.com/dbohdan/structured-text-tools)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanburzo%2Fyamatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanburzo%2Fyamatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanburzo%2Fyamatter/lists"}