0.1.0 • Published 2 years ago

alfons v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Alfons

Create Alfred workflows in Javascript

Features

  • Easy setup with npx alfons init
  • No Node.js requirement for users
  • Built-in fetch that 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 init

That'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
  })));
}