Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/os-x-contacts
Query all macOS Address Book contacts.
https://github.com/derhuerst/os-x-contacts
address-book contacts macos osx
Last synced: 5 days ago
JSON representation
Query all macOS Address Book contacts.
- Host: GitHub
- URL: https://github.com/derhuerst/os-x-contacts
- Owner: derhuerst
- License: isc
- Created: 2016-12-05T23:04:44.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-08-21T14:05:06.000Z (about 1 year ago)
- Last Synced: 2024-05-01T23:29:55.933Z (7 months ago)
- Topics: address-book, contacts, macos, osx
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# *os-x-contacts*
**Query all [macOS *Address Book*](https://support.apple.com/en-us/HT201728) contacts.** Uses [`contacts-cli`](https://github.com/pepebecker/contacts-cli) under the hood.
[![npm version](https://img.shields.io/npm/v/os-x-contacts.svg)](https://www.npmjs.com/package/os-x-contacts)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/os-x-contacts.svg)
![minimum Node.js version](https://img.shields.io/node/v/os-x-contacts.svg)
[![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)
[![chat with me on Twitter](https://img.shields.io/badge/chat%20with%20me-on%20Twitter-1da1f2.svg)](https://twitter.com/derhuerst)## Installing
```shell
npm install os-x-contacts
```## Usage
Returns a [readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) in [object mode](https://nodejs.org/api/stream.html#stream_object_mode).
```js
import {readContacts} from 'os-x-contacts'for await (contact of contacts()) {
console.log(contact)
}
``````js
{
lastName: 'Appleseed', firstName: 'John',
phones: [ { label: 'mobile', value: '+49123456789' } ],
emails: [ { label: 'home', value: '[email protected]' } ]
}
{
lastName: 'Appleseed', firstName: 'Jane',
phones: [ { label: 'mobile', value: '+49123456789' } ],
emails: [ { label: 'home', value: '[email protected]' } ]
}
```## Contributing
If you have a question or need support using `os-x-contacts`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, use [the issues page](https://github.com/derhuerst/os-x-contacts/issues).