Skip to content

Random Deno scripts (a basic Todoist CLI, a webextension messaging gateway, etc.)

Notifications You must be signed in to change notification settings

drmercer/deno-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dan's Miscellaneous Deno Scripts

Deno is great. ❤️

Todoist CLI

Example:

// example.ts
import * as commands from "https://raw.githubusercontent.com/drmercer/deno-scripts/master/todoist/cli/commands.ts";
import { commandHandler } from "https://raw.githubusercontent.com/drmercer/deno-scripts/master/cli-utils/command.ts";

const handler = commandHandler({
  commands,
  parentCommandName: "td",
});

const success = await handler(Deno.args);

Deno.exit(success ? 0 : 1);

Usage:

$ deno install --name=td --unstable --location=https://any.origin.example --allow-net=api.todoist.com ./example.ts

$ td init
Enter your Todoist API token: <token>
Access token saved under origin https://any.origin.example

$ td sync
Syncing...
State saved: { tasks: 85, projects: 6 }

$ td add 'This is a task'
Adding 'This is a task'...

Todoist API

Example:

import { Todoist } from "https://raw.githubusercontent.com/drmercer/deno-scripts/master/todoist/api/api.ts";

const td = Todoist("<YOUR API TOKEN>");
let sync = await td.sync();

if (sync.success) {
  console.log(sync.data.tasks?.length + " tasks found");
}

About

Random Deno scripts (a basic Todoist CLI, a webextension messaging gateway, etc.)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published