{"id":15699005,"url":"https://github.com/pgilad/jade-globals","last_synced_at":"2025-03-30T14:25:29.459Z","repository":{"id":31798003,"uuid":"35364542","full_name":"pgilad/jade-globals","owner":"pgilad","description":"Detect which global variables are needed for your jade templates","archived":false,"fork":false,"pushed_at":"2015-05-22T17:30:07.000Z","size":118,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-07T06:20:48.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/pgilad.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":"2015-05-10T09:14:46.000Z","updated_at":"2020-09-15T11:16:30.000Z","dependencies_parsed_at":"2022-07-16T13:00:28.897Z","dependency_job_id":null,"html_url":"https://github.com/pgilad/jade-globals","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/pgilad%2Fjade-globals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgilad%2Fjade-globals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgilad%2Fjade-globals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgilad%2Fjade-globals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgilad","download_url":"https://codeload.github.com/pgilad/jade-globals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246329600,"owners_count":20759927,"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":[],"created_at":"2024-10-03T19:37:20.495Z","updated_at":"2025-03-30T14:25:29.437Z","avatar_url":"https://github.com/pgilad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jade-globals [![Build Status](http://img.shields.io/travis/pgilad/jade-globals.svg?style=flat)](https://travis-ci.org/pgilad/jade-globals)\n\n\u003e Detect which global variables are needed for your jade templates\n\nGiven:\n```jade\n.some-class(title=externalTitle)\n    table#crazy-table(class=externalClass)\n        if showHeader\n            thead\n```\n\nUsing `jade-globals` will output:\n\n`['externalTitle', 'externalClass', 'showHeader']`\n\nIt's a tool meant to map your required dependencies in your jade files.\n\n## Install\n\n```sh\n# install as a dev dependency\n$ npm install --save-dev jade-globals\n\n# install globally for use as cli\n$ npm install --global jade-globals\n```\n\n## Usage\n\n```js\nvar fs = require('fs');\nvar jadeGlobals = require('jade-globals');\n\nvar contents = fs.readFileSync('crazy-template.jade', 'utf8');\nconsole.log(jadeGlobals(contents));\n// =\u003e ['global1', 'global2']\n```\n\nUsage as a cli:\n\n```sh\n❯ jade-globals --help\n\n  Usage: jade-globals [options] \u003cfile\u003e\n\n  Detect which global variables are needed for your jade templates\n\n  Options:\n\n    -h, --help               output usage information\n    -V, --version            output the version number\n    -s, --show-jade-global   Show the jade global as well\n    -i, --ignore \u003ckeywords\u003e  Ignore keyword (default: [])\n\n  Examples:\n\n    $ jade-globals template.jade\n    $ jade-globals --ignore someGlobal template.jade\n    $ cat template.jade | jade-globals\n```\n\n## Options\n\n### jadeGlobals(contents, params)\n\n#### contents\n\n`String` the contents of the jade file to parse.\n\n**Required**\n\n#### params\n\n`Object` optional params and their defaults:\n```js\n{\n    // the `jade` global is hidden by default. Set to true to include it.\n    showJadeGlobal: false\n    // optional ignore list\n    ignore: []\n}\n```\n\n## License\n\nMIT © [Gilad Peleg](http://giladpeleg.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgilad%2Fjade-globals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgilad%2Fjade-globals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgilad%2Fjade-globals/lists"}