{"id":13571966,"url":"https://github.com/sindresorhus/xbar","last_synced_at":"2025-04-05T03:03:38.997Z","repository":{"id":42562886,"uuid":"49339397","full_name":"sindresorhus/xbar","owner":"sindresorhus","description":"Simplifies BitBar app plugin creation","archived":false,"fork":false,"pushed_at":"2023-11-06T06:57:42.000Z","size":150,"stargazers_count":355,"open_issues_count":2,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T22:26:22.482Z","etag":null,"topics":["bitbar","macos","menubar","nodejs","npm-package"],"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/sindresorhus.png","metadata":{"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"},"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}},"created_at":"2016-01-09T20:05:30.000Z","updated_at":"2025-01-11T05:24:09.000Z","dependencies_parsed_at":"2023-12-19T05:56:15.507Z","dependency_job_id":"65807e88-0478-4559-adaf-ec70f310a71e","html_url":"https://github.com/sindresorhus/xbar","commit_stats":{"total_commits":42,"total_committers":11,"mean_commits":"3.8181818181818183","dds":"0.30952380952380953","last_synced_commit":"06cce5490b1fea1ad5b0cbf75b7427b03750465a"},"previous_names":["sindresorhus/bitbar"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fxbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fxbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fxbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fxbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/xbar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280260,"owners_count":20912967,"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":["bitbar","macos","menubar","nodejs","npm-package"],"created_at":"2024-08-01T14:01:09.673Z","updated_at":"2025-04-05T03:03:38.978Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript"],"sub_categories":[],"readme":"# xbar\n\n\u003e Simplifies [xbar](https://github.com/matryer/xbar) app plugin creation\n\nCreate your plugin using a nice API instead of having to manually construct a big string.\n\n*Requires xbar v2 or later.*\n\n\u003cimg src=\"screenshot.png\" width=\"232\" height=\"196\"\u003e\n\n## Install\n\n```sh\nnpm install xbar\n```\n\n## Usage\n\n```js\n#!/usr/bin/env node\nimport xbar, {separator, isDarkMode} from 'xbar';\n\nxbar([\n\t{\n\t\ttext: '❤',\n\t\tcolor: isDarkMode ? 'white' : 'red',\n\t\tdropdown: false\n\t},\n\tseparator,\n\t{\n\t\ttext: 'Unicorns',\n\t\tcolor: '#ff79d7',\n\t\tsubmenu: [\n\t\t\t{\n\t\t\t\ttext: ':tv: Video',\n\t\t\t\thref: 'https://www.youtube.com/watch?v=9auOCbH5Ns4'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: ':book: Wiki',\n\t\t\t\thref: 'https://en.wikipedia.org/wiki/Unicorn'\n\t\t\t}\n\t\t]\n\t},\n\tseparator,\n\t'Ponies'\n]);\n```\n\nCreate a file with the above code in the xbar plugins directory and make sure to `chmod +x filename.js` it. [Read more.](https://github.com/matryer/xbar#installing-plugins)\n\n**Note:** You need to either have a `package.json` file with `{\"type\": \"module\"}` or use the `.mjs` extension instead of `.js`.\n\n*Change `node` in `#!/usr/bin/env node` to the path of your Node.js binary. This is a [known issue](https://github.com/matryer/xbar/issues/36) in xbar.*\n\n## API\n\n### xbar(items, options?)\n\n#### items\n\nType: `Array\u003cstring | object\u003e`\n\nAn item can be a string with the text or an object with the text in a `text` property and any of the `options`. The text can be multiple lines, but for the first item, only the first line will be shown in the menubar.\n\n##### submenu\n\nType: `Array\u003cstring | object\u003e`\n\nIt will add a submenu to the current item. A submenu is composed of an array of items.\n\n#### options\n\nType: `object`\n\nYou can use any of the [supported options](https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md#plugin-api).\n\nApplies to all items unless overridden in the item.\n\n### separator\n\nAdd a separator.\n\n### isDarkMode\n\nType: `boolean`\n\nCheck whether dark mode is enabled.\n\n### isXbar\n\nType: `boolean`\n\nCheck whether the script is running from xbar.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fxbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fxbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fxbar/lists"}