# bitbar

> Simplifies BitBar app plugin creation

Latest version **2.0.0** (published 2021-10-13) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install bitbar
pnpm add bitbar
yarn add bitbar
bun add bitbar
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-10-13 |
| First published | 2016-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 361 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | bitbar, macos, menubar, app, bit, bar |

## Links

- npm: https://www.npmjs.com/package/bitbar
- Repository: https://github.com/sindresorhus/bitbar
- Homepage: https://github.com/sindresorhus/bitbar#readme
- Issues: https://github.com/sindresorhus/bitbar/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/bitbar

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-10-13
- 1.3.2 — 2021-04-24
- 1.3.1 — 2020-04-01
- 1.3.0 — 2019-12-17
- 1.2.0 — 2019-11-19
- 1.1.0 — 2019-11-13
- 1.0.0 — 2019-06-23
- 0.4.0 — 2018-11-12
- 0.3.0 — 2016-06-16
- 0.2.1 — 2016-03-06
- 0.2.0 — 2016-02-12
- 0.1.0 — 2016-01-09
- 0.0.1 — 2016-01-09

## README

# bitbar

> Simplifies [BitBar](https://github.com/matryer/bitbar) app plugin creation

Create your plugin using a nice API instead of having to manually construct a big string.

*Requires BitBar 1.9 or higher.*

<img src="screenshot.png" width="232" height="196">

## Install

```sh
npm install bitbar
```

## Usage

```js
#!/usr/bin/env node --input-type=module
import bitbar, {separator, isDarkMode} from 'bitbar';

bitbar([
	{
		text: '❤',
		color: isDarkMode ? 'white' : 'red',
		dropdown: false
	},
	separator,
	{
		text: 'Unicorns',
		color: '#ff79d7',
		submenu: [
			{
				text: ':tv: Video',
				href: 'https://www.youtube.com/watch?v=9auOCbH5Ns4'
			},
			{
				text: ':book: Wiki',
				href: 'https://en.wikipedia.org/wiki/Unicorn'
			}
		]
	},
	separator,
	'Ponies'
]);
```

Create a file with the above code in the BitBar plugins directory and make sure to `chmod +x filename.js` it. [Read more.](https://github.com/matryer/bitbar#installing-plugins)

*Change `node` in `#!/usr/bin/env node` to the path of your Node.js binary. This is a [known issue](https://github.com/matryer/bitbar/issues/36) in BitBar.*

## API

### bitbar(items, options?)

#### items

Type: `Array<string | object>`

An 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.

##### submenu

Type: `Array<string | object>`

It will add a submenu to the current item. A submenu is composed of an array of items.

#### options

Type: `object`

You can use any of the [supported options](https://github.com/matryer/bitbar#plugin-api).

Applies to all items unless overridden in the item.

### separator

Add a separator.

### isDarkMode

A boolean of whether macOS dark mode is enabled.

---
_Source: https://npm.io/package/bitbar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
