alfons
v0.1.0
Published
Make Alfred workflows in Javascript
Readme
Alfons
Create Alfred workflows in Javascript
Features
- Easy setup with
npx alfons init - No Node.js requirement for users
- Built-in
fetchthat follows the Fetch API standard - Access Alfred config and environment variables
- Support for AppleScript/JXA
- Easy build process
Getting started
First, create a new Blank Workflow. Fill in the desired fields.
Right click your new workflow, and Open in Terminal. Run the following command
npx alfons initThat's it. Open the newly created index.js file and get coding!
Example
import alfons from "alfons";
export const run = (argv) => {
const input = argv[0].trim();
const todos = alfons.fetch('https://jsonplaceholder.typicode.com/users/1/todos');
alfons.output(todos.map(todo => ({
title = todo.title,
subtitle = todo.completed ? "Completed" : "Not completed",
arg = todo.id
})));
}