{"id":15018088,"url":"https://github.com/jeremyben/nunjucks-cli","last_synced_at":"2025-10-23T15:30:51.426Z","repository":{"id":44580125,"uuid":"57893386","full_name":"jeremyben/nunjucks-cli","owner":"jeremyben","description":"Simple Nunjucks CLI wrapper and templates watcher","archived":false,"fork":false,"pushed_at":"2022-12-03T14:45:56.000Z","size":109,"stargazers_count":27,"open_issues_count":19,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-30T19:11:17.313Z","etag":null,"topics":["cli","npm","nunjucks","template-engine"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nunjucks-cli","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/jeremyben.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-05-02T13:46:28.000Z","updated_at":"2024-05-21T14:54:46.000Z","dependencies_parsed_at":"2023-01-23T04:46:04.435Z","dependency_job_id":null,"html_url":"https://github.com/jeremyben/nunjucks-cli","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyben%2Fnunjucks-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyben%2Fnunjucks-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyben%2Fnunjucks-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyben%2Fnunjucks-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyben","download_url":"https://codeload.github.com/jeremyben/nunjucks-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237843931,"owners_count":19375230,"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","npm","nunjucks","template-engine"],"created_at":"2024-09-24T19:51:26.147Z","updated_at":"2025-10-23T15:30:51.124Z","avatar_url":"https://github.com/jeremyben.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nunjucks-cli\n\nSimple Nunjucks CLI Wrapper and templates watcher, to generate static HTML files.\n\n## Installation\n\n```bash\nnpm i -D nunjucks-cli # local\nnpm i -g nunjucks-cli # global\n```\n\n## Usage\n\n```bash\nnunjucks \u003cfile|glob\u003e [context] [options]\n```\n\n_For convenience, `process.env` object is added to the context as `env`._\n\n#### Basic examples\n\n```bash\nnunjucks foo.tpl data.json\n```\n\nCompiles `foo.tpl` to `foo.html` with data from `data.json` (and variables from `process.env` as `env`).\n\n```bash\nnunjucks **/*.tpl\n```\n\nCompiles all `.tpl` files (including subdirectories), except the ones starting by `_` (so you can use them as layouts).\n\n## Options\n\n### `--path \u003cdirectory\u003e`\n\n`-p \u003cdirectory\u003e`\n\nPath where the templates live. Default to the current working directory.\nSee \u003chttps://mozilla.github.io/nunjucks/api.html#configure\u003e\n\n### `--out \u003cdirectory\u003e`\n\n`-o \u003cdirectory\u003e`\n\nOutput directory.\n\n### `--watch`\n\n`-w`\n\nAllows to keep track of file changes and render accordingly (except files starting by `_`).\n\n### `--extension \u003cext\u003e`\n\n`-e \u003cext\u003e`\n\nExtension for rendered files. Defaults to `html`.\n\n### `--options \u003cfile\u003e`\n\n`-O \u003cfile\u003e`\n\nTakes a json file as Nunjucks options. Defaults are :\n\n```json\ntrimBlocks: true,\nlstripBlocks: true,\nnoCache: true\n```\n\nSee \u003chttps://mozilla.github.io/nunjucks/api.html#configure\u003e\n\n#### Advanced examples\n\n```bash\nnunjucks foo.tpl -p src -o dist -O nj.json\n```\n\nCompiles `src/foo.tpl` to `dist/foo.html`, with `nj.json` as nunjucks environnement options.\n\n```bash\nnunjucks *.tpl data.json -w -p src\n```\n\nCompiles all `.tpl` files (except ones starting with `_`) in the `src` folder to the current working directory, with `data.json` as metadata, and keeps running in the background for files changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyben%2Fnunjucks-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremyben%2Fnunjucks-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyben%2Fnunjucks-cli/lists"}