node-reminders
A NodeJS and TypeScript wrapper for the macOS Reminders App.
- 🔥 Easy to use interface to create, retrieve, update and delete lists and reminders
- 👾 CommonJS and ES6 modules
- 🤖 Typings available
- 🎩 JXA-based communication with the Reminders App
- 🏄♂️ Fully unit tested
Installation
npm i node-reminders
Usage
Use it in JavaScript with CommonJS or in TypeScript with ES6 modules.
// with JavaScript; // with TypeScript;
API
getLists(): Promise<List[]>
Resolves with the list of reminders lists.
getList(id: string): Promise<List>
Resolves with the detail of a specific list.
createList(data: List): Promise<string>
Creates a new reminders list and resolves with its ID.
getReminders(listId: string, props?: Array<keyof Reminder>): Promise<Reminder[]>
Resolves with the reminders of a given list. Optionally specify which props to retrieve. The more props, the slower the query. See the reminders example for more.
getReminder(reminderId: string, props?: Array<keyof Reminder>): Promise<Reminder>
Resolves with the information of a specific reminder. Optionally specify which props to retrieve.
updateReminder(id: string, data: Partial<Reminder>): Promise<string>
Updates a reminder and resolves with its ID. Pass only the subset of parameters to modify.
deleteReminder(id: string): Promise<true>
Deletes a reminder and resolves with true
if successful. Throws exception otherwise.
createReminder(listId: string, data: Partial<Reminder>): Promise<string>
Creates a reminder in a list and resolves with its ID. See example.
Examples
List management
Get Lists
; ;
Get List
; ;
Create List
; ;
Note: List deletion is not supported. It's simply not allowed either via .jxa
or .applescript
directly.
Reminders management
Get reminders
; ;
Get reminder
; ;
Update reminder
; ;
Delete reminder
; ;
Create reminder
; ;
Interfaces
The interface prop names are self-explanatory. Descriptions are intentionally omitted.
List
Param | Type |
---|---|
name | string |
id | string |
Reminder
Param | Type |
---|---|
name | string |
body | string |
id | string |
complete | boolean |
completionDate | Date |
creationDate | Date |
dueDate | Date |
modificationDate | Date |
remindMeDate | Date |
priority | number |
How it works
Under the hood, this library is an interface to run JXA scripts in the terminal. JXA is JavaScript for OSX automation. You can find all the scripts in src/jxa
. Arguments and outputs are passed back and forth via stringified objects.
Licence
MIT © Carlos Roso