Socket
Book a DemoInstallSign in
Socket

toggl-toggle

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toggl-toggle

Toggles your last Toggl entry

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Toggl Toggle

A node library that easily toggles the last Toggl entry.

Usage

const token = '<your-api-token>';
const toggle = require('toggl-toggle');

toggle(token).then(console.log).catch(console.error);

Requires node@>=4.3.2

How it works

Sadly there's no native toggle API, so this library makes use of multiple API calls.

The logic flow follows:

let task = getCurrentTask()

if (task):
  stop(task)
else:
  let lastTasks = getLastTask()
  start(lastTasks)

Keywords

toggl

FAQs

Package last updated on 25 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts