New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

beeminder

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beeminder

NodeJS wrapper for the Beeminder API

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
26
44.44%
Maintainers
1
Weekly downloads
 
Created
Source

beeminderjs

NodeJS wrapper for the Beeminder API. Created for integration with Complice, a productivity app that's more qualified-self than quantified-self.

BeeminderJS is designed for use within NodeJS apps, although it also works in a very basic rudimentary way from command-line. I'm open to people contributing new functions to either purpose!

Install to your node project

npm install --save beeminder

Usage as a library

As of 2.0.0, promises only. Errors may also be slightly different, due to using fetch instead of curlrequest.

Refer to the Beeminder API docs for information on goal creation parameters or what will be returned when calling these endpoints.

var beeminder = require('beeminder')
var bm = beeminder(auth_token)

bm.getUser(function (err, result) {
  console.log(err || result)
  // do something
})

bm.getGoal('goalslug', function (err, result) {...})

bm.createGoal('goalslug', params, function (err, result) {...})

bm.getDatapoints('goalslug', function (err, result) {...})

bm.createDatapoint('goalslug', {
  value: 1, // {type: Number, required: true},
  timestamp: new Date("2015-02-21").valueOf() // {type: Number, default: now},
  comment: 'updated readme',
  sendmail: true, // if you want the user to be emailed
  // requestid allows you to run command again without creating duplicate datapoints
  requestid: 'thisHasToBeAlphanumericWhichIsWhyThereAreNoSpaces',
}, function (err, result) {...})

bm.createGoal('goalslug', params).then(function () {
  return bm.createDatapoints('goalslug', [{...}])
}).then(function () {
  res.send('Created goal and added datapoints')  
}).catch(...)

Install as a command-line tool

sudo npm install --global beeminder

bm # run this once to ensure you're authenticated

Usage as a command-line tool

bm user
bm status # outputs a list of goals sorted by derail time
bm goal <goalslug>
bm datapoints <goalslug>
bm createdatapoint <goalslug> <value> [<optional comment, in quotes if it has a space>]
bm cd # same as createdatapoint

Example

I have the following in .bash_aliases, which allows me to post a user-visible improvement simultaneously to beeminder (m/complice-uvi) and twitter (@compluvi). Requires the twitter bash client t, available here (although barely still supported since it uses an old version of Ruby and an unavailable-for-new-apps Twitter API).

uvi () {
  bm cd complice-uvi 1 "$@"
  t update "$@"
}

# example
uvi "UVIs will be posted more frequently because I can now post them from command line :D"

todo

  • implement other endpoints (feel free to ask for them or to submit pull requests)

Keywords

beeminder

FAQs

Package last updated on 31 May 2024

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